david/myzsh
david
/
myzsh
Archived
1
0
Fork 0

added automatic/on login update feature

This commit is contained in:
david 2013-01-18 16:42:30 +01:00
parent 5d0cd10ef8
commit a640b78422
1 changed files with 12 additions and 5 deletions

View File

@ -1,8 +1,15 @@
# run weeklies
newtimestamp=$(date +%Y%m%d)
oldtimestamp=$($ZSH/lastrun)
echo $newtimestamp
echo $oldtimestamp
# run myzsh update (every 7 days)
timestamp=$(date +%s)
lastrun=$(cat $ZSH/lastrun)
if [ $((lastrun+604800)) -le $timestamp ]; then
echo -e "do you want to update myzsh? [y/n] \c"
read choice
if [ $choice = "y" ]; then
echo "running update of myzsh now.."
cd $ZSH; git pull origin master; cd -
echo $timestamp > $ZSH/lastrun
fi
fi
# load core