pushzshconfig 20.06.2013 15:50
This commit is contained in:
parent
27b209cafd
commit
37849ce0ae
18
myzsh.sh
18
myzsh.sh
|
@ -21,6 +21,24 @@ timestamp=$(date +%s)
|
|||
if [ -r $ZSH/lastrun ];then
|
||||
lastrun=$(cat $ZSH/lastrun)
|
||||
if [ $((lastrun+604800)) -le $timestamp ]; then
|
||||
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
|
||||
cd $ZSH; git remote remove origin
|
||||
git remote add origin git@github.com:beyondthewall/myzsh.git
|
||||
else
|
||||
cd $ZSH; git remote remove origin
|
||||
git remote add origin git@github.com:beyondthewall/myzsh.git
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
echo "running update of myzsh now.."
|
||||
cd $ZSH; git pull origin master; cd -
|
||||
echo $timestamp > $ZSH/lastrun
|
||||
|
|
|
@ -54,14 +54,14 @@ rdp()
|
|||
|
||||
}
|
||||
|
||||
updatezshconfig()
|
||||
pullmyzsh()
|
||||
{
|
||||
cd $ZSH
|
||||
git pull origin master
|
||||
cd -
|
||||
}
|
||||
|
||||
pushzshconfig()
|
||||
pushmyzsh()
|
||||
{
|
||||
|
||||
cd $ZSH
|
||||
|
|
Reference in New Issue