added automatic/on login update feature
This commit is contained in:
parent
5d0cd10ef8
commit
a640b78422
17
myzsh.sh
17
myzsh.sh
|
@ -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
|
||||
|
|
Reference in New Issue