2013-01-18 23:27:24 +01:00
|
|
|
# check if there is canges to be pushed
|
|
|
|
cd $ZSH
|
|
|
|
local SUBMODULE_SYNTAX=''
|
|
|
|
if [[ $POST_1_7_2_GIT -gt 0 ]]; then
|
|
|
|
SUBMODULE_SYNTAX="--ignore-submodules=dirty"
|
|
|
|
fi
|
|
|
|
if [[ -n $(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null) ]]; then
|
|
|
|
echo -e "do you want to push myzsh changes? [y/n] \c"
|
|
|
|
read choice
|
|
|
|
if [ $choice = "y" ]; then
|
2013-01-19 10:36:35 +01:00
|
|
|
git add **/*[^lastrun]
|
2013-01-18 23:27:24 +01:00
|
|
|
git commit -am "pushzshconfig $(date "+%d.%m.%Y %H:%M")"
|
|
|
|
git push origin master
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
cd - > /dev/null
|
|
|
|
|
|
|
|
|
2013-01-18 16:42:30 +01:00
|
|
|
# run myzsh update (every 7 days)
|
|
|
|
timestamp=$(date +%s)
|
2013-01-18 16:50:33 +01:00
|
|
|
if [ -r $ZSH/lastrun ];then
|
|
|
|
lastrun=$(cat $ZSH/lastrun)
|
|
|
|
if [ $((lastrun+604800)) -le $timestamp ]; then
|
2013-06-20 15:50:16 +02:00
|
|
|
cd $ZSH; git remote -v | grep -i bitbucket >> /dev/null
|
|
|
|
if [ $? -eq 0 ]; then
|
|
|
|
choice=""
|
|
|
|
echo "myzsh moved to github.com. unfortunately your"
|
|
|
|
echo "myzsh repository still points to bitbucket.org."
|
|
|
|
echo -e "do you want to fix this? [y/n] \c"
|
|
|
|
read choice
|
|
|
|
if [ $choice = "y" ]; then
|
|
|
|
cd $ZSH; git remote -v | grep @ >> /dev/null
|
|
|
|
if [ $? -eq 0 ]; then
|
2013-06-20 15:57:21 +02:00
|
|
|
cd $ZSH; git remote rm origin
|
2013-06-20 15:50:16 +02:00
|
|
|
git remote add origin git@github.com:beyondthewall/myzsh.git
|
|
|
|
else
|
2013-06-20 15:57:21 +02:00
|
|
|
cd $ZSH; git remote rm origin
|
|
|
|
git remote add origin https://github.com/beyondthewall/myzsh.git
|
2013-06-20 15:50:16 +02:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
2013-06-20 13:47:43 +02:00
|
|
|
echo "running update of myzsh now.."
|
|
|
|
cd $ZSH; git pull origin master; cd -
|
|
|
|
echo $timestamp > $ZSH/lastrun
|
2013-01-18 16:42:30 +01:00
|
|
|
fi
|
2013-01-18 16:50:33 +01:00
|
|
|
else
|
|
|
|
echo $timestamp > $ZSH/lastrun
|
2013-01-18 16:42:30 +01:00
|
|
|
fi
|
2013-01-18 16:16:57 +01:00
|
|
|
|
|
|
|
|
2013-01-17 14:59:21 +01:00
|
|
|
# load core
|
|
|
|
for config_file ($ZSH/core/*.zsh); do
|
|
|
|
source $config_file
|
|
|
|
done
|
|
|
|
|
|
|
|
# load plugins
|
|
|
|
for plugin ($plugins); do
|
|
|
|
if [ -f $ZSH/plugins/$plugin.zsh ]; then
|
|
|
|
source "$ZSH/plugins/$plugin.zsh"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# load theme
|
|
|
|
if [ -f $ZSH/themes/$THEME.zsh ]; then
|
|
|
|
source "$ZSH/themes/$THEME.zsh"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# load completion
|
|
|
|
autoload -U compinit
|
|
|
|
compinit -i
|