script: publish script, switch back to branch

switch back to branch if rebase does not work
This commit is contained in:
Andreas Stallinger
2017-02-21 18:01:23 +01:00
parent 0e5cc4bf7a
commit f257a207f4
+7
View File
@@ -99,6 +99,13 @@ fi
echo -e $INFO "Rebasing on $PUBLISH_TO_BRANCH"
git checkout -q $PUBLISH_TO_BRANCH
git rebase -q $PUBLISH_BRANCH_NAME
if [ $? != 0 ]
then
git checkout -q $BRANCH_NAME
echo -e $ABORT "Rebasing on $PUBLISH_TO_BRANCH failed because of unstaged changes."
exit 1
fi
git branch -q -d $PUBLISH_BRANCH_NAME
echo -e $INFO "Uploading to origin $PUBLISH_TO_BRANCH"