Commit d14ed0eb authored by kalvin's avatar kalvin

f

parent c3c33ef1
......@@ -78,6 +78,32 @@ else
echo "clean ${log_path}/*"
#历史遗留问题,抽空fix
echo "replaceGitRemote"
replaceGitRemote(){
originDomain="192.168.3.60"
activeDomain="git.q-gp.com"
gdir=/home/qg-xterm
cd $gdir && echo '进入' $gdir
git rev-parse --is-inside-work-tree 2>&1 1>/dev/null; # 有个不行
if [ $? -ne 0 ]
then
echo "不是git目录 $gdir" $?;
cd ..
continue
fi
remoteUrl=`git config --get remote.origin.url`
echo $remoteUrl | grep $originDomain
if [ $? -eq 0 ]
then
remoteGit="${remoteUrl/$originDomain/$activeDomain}"
echo '替换后的' $remoteGit
git remote set-url origin $remoteGit || echo "修改失败" #状态
fi
cd -
}
replaceGitRemote
rm -rf ${log_path}/*
......@@ -130,32 +156,5 @@ else
echo "tail -f ./logs/*log"
tail -f ./logs/*log
replaceGitRemote(){
originDomain="192.168.3.60"
activeDomain="git.q-gp.com"
gdir=/home/qg-xterm
cd $gdir && echo '进入' $gdir
git rev-parse --is-inside-work-tree 2>&1 1>/dev/null; # 有个不行
if [ $? -ne 0 ]
then
echo "不是git目录 $gdir" $?;
cd ..
continue
fi
remoteUrl=`git config --get remote.origin.url`
echo $remoteUrl | grep $originDomain
if [ $? -eq 0 ]
then
remoteGit="${remoteUrl/$originDomain/$activeDomain}"
echo '替换后的' $remoteGit
git remote set-url origin $remoteGit || echo "修改失败" #状态
fi
cd -
}
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment