diff --git a/run.sh b/run.sh index 82678e1..91355d5 100755 --- a/run.sh +++ b/run.sh @@ -22,23 +22,25 @@ do fi done - git fetch $GIT_URL >> $log 2>&1 + git fetch $GIT_URL >> /dev/null if [ $? -ne 0 ]; then - echo "Git fetch from $GIT_URL failed. For more details, see $log" + echo "Git fetch from $GIT_URL failed." sleep $delay continue fi + current_commit=`git rev-parse HEAD` latest_commit=`git log "--format=%G? %H" origin/master | grep ^G | head -n 1 | cut -d' ' -f2` if test -z $latest_commit; then + echo "Latest commit couldn't be found." sleep $delay continue fi - git reset --hard >> $log 2>&1 - git checkout $latest_commit -f >> $log 2>&1 + git reset --hard + git checkout $latest_commit -f if [ $? -ne 0 ]; then - echo "Git checkout failed. For more details, see $log" + echo "Git checkout failed." sleep $delay continue fi