diff --git a/helpers b/helpers index 04beaf0..87f86b7 100644 --- a/helpers +++ b/helpers @@ -55,15 +55,14 @@ update_repo() { git pull origin master fi set +e - # checkout the tag relating to the clear version used to build against - git checkout tags/"$CLRVER" - local branch="${CLRVER}_mix" - git rev-parse --verify "$branch" + # Ensure that CLRVER exists and is a tag + git rev-parse --verify "${CLRVER}^{tag}" &> /dev/null if [ $? -eq 0 ]; then - git checkout "$branch" - git pull - else - git checkout -b "$branch" + # Always reset the _mix branch to be based off the tag + git checkout -B "${CLRVER}_mix" "${CLRVER}" + else + echo "ERROR: invalid CLEAR_VERSION in builder.conf (${CLRVER})" + exit 1 fi set -e cd ..