setup: improved sh scripts

- switched to !/bin/bash because of issues with echo -e on Mac OS
- improved git-sync-master.sh to also rebase on current feature branch
- improved logs in git-publish.sh
- changed build scripts to execute from /bin
This commit is contained in:
Eberhard Graether
2014-04-02 22:42:27 +02:00
parent 6afd52a3d2
commit b854cb1f46
8 changed files with 70 additions and 42 deletions
+5 -4
View File
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
ABORT="\033[31mAbort:\033[00m"
SUCCESS="\033[32mSuccess:\033[00m"
@@ -40,7 +40,7 @@ echo -e $INFO "Checking master"
# check if master is up to date
if [[ -n $(git diff origin/master) ]]
then
echo -e $ABORT "Your master is not up-to-date. Run 'sync.sh' to update your master, then run 'git rebase master' to update branch $BRANCH_NAME."
echo -e $ABORT "Your master is not up-to-date. Run 'git-sync-master.sh' to update master and rebase $BRANCH_NAME."
git checkout -q $BRANCH_NAME
exit 1
fi
@@ -75,6 +75,7 @@ git commit
if [ $? != 0 ]
then
echo -e $ABORT "Commit was aborted."
git checkout -q $BRANCH_NAME
git branch -q -D $PUBLISH_BRANCH_NAME
exit 1
@@ -92,9 +93,9 @@ if [ $? != 0 ]
then
git reset --hard -q HEAD^
git checkout -q $BRANCH_NAME
echo -e $ABORT "Pushing to origin master has failed, there are new remote changes. Run 'sync.sh' to update your master, then run 'git rebase master' to update branch $BRANCH_NAME."
echo -e $ABORT "Pushing to origin master has failed, there are new remote changes. Run 'git-sync-master.sh' to update master and rebase $BRANCH_NAME."
exit 1
fi
echo -e $SUCCESS "Published branch $BRANCH_NAME successfully"
echo -e $SUCCESS "Published $BRANCH_NAME successfully"
exit 0