scripts: replaced echo with echo -e for color in linux (maybe windows)

This commit is contained in:
Andreas Stallinger
2014-03-31 20:42:53 +02:00
parent 055b3d0029
commit f61425b4e8
4 changed files with 32 additions and 32 deletions
+10 -10
View File
@@ -10,46 +10,46 @@ BRANCH_NAME=$(git symbolic-ref -q --short HEAD)
# check if on branch
if [ -z $BRANCH_NAME ]
then
echo $ABORT "You are not on any branch."
echo -e $ABORT "You are not on any branch."
exit 1
fi
# switch to master
echo $INFO "Switching to master"
echo -e $INFO "Switching to master"
git checkout -q master
if [ $? != 0 ]
then
echo $ABORT "Switching to master failed."
echo -e $ABORT "Switching to master failed."
exit 1
fi
# check clean index
echo $INFO "Checking index"
echo -e $INFO "Checking index"
if [[ -n $(git diff HEAD) ]]
then
echo $ABORT "You have uncommited changes on master."
echo -e $ABORT "You have uncommited changes on master."
git checkout -q "$BRANCH_NAME"
exit 1
fi
# fetch remote changes
echo $INFO "Fetching changes"
echo -e $INFO "Fetching changes"
git fetch -q origin master
if [ $? != 0 ]
then
echo $ABORT "Fetching from origin master failed."
echo -e $ABORT "Fetching from origin master failed."
git checkout -q "$BRANCH_NAME"
exit 1
fi
if [[ -z $(git diff origin/master) ]]
then
echo $SUCCESS "Your master is already up-to-date."
echo -e $SUCCESS "Your master is already up-to-date."
git checkout -q "$BRANCH_NAME"
exit 0
fi
@@ -59,11 +59,11 @@ git rebase -q origin/master
if [ $? != 0 ]
then
echo $ALERT "Rebasing on master caused conflicts. This should never happen. Follow the instructions above to resolve them then use 'git push origin master' to update the remote."
echo -e $ALERT "Rebasing on master caused conflicts. This should never happen. Follow the instructions above to resolve them then use 'git push origin master' to update the remote."
exit 1
fi
git checkout -q "$BRANCH_NAME"
echo $SUCCESS "Updated master"
echo -e $SUCCESS "Updated master"
exit 0