david/myzsh
david
/
myzsh
Archived
1
0
Fork 0

pushzshconfig 18.01.2013 23:27

This commit is contained in:
david 2013-01-18 23:27:24 +01:00
parent 233dd6d600
commit a9d041fefa
2 changed files with 30 additions and 0 deletions

View File

@ -1,3 +1,20 @@
# 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
git commit -am "pushzshconfig $(date "+%d.%m.%Y %H:%M")"
git push origin master
fi
fi
cd - > /dev/null
# run myzsh update (every 7 days)
timestamp=$(date +%s)
if [ -r $ZSH/lastrun ];then

View File

@ -97,6 +97,19 @@ update()
}
is_dirty() {
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
return 1
else
return 0
fi
}
info()
{
echo -e "hostname: $(hostname)"