Reversed logic for branch detection

This commit is contained in:
Joseph Lenox 2017-03-06 16:58:51 -06:00
parent ca0000d7b2
commit 439daf15d3
2 changed files with 12 additions and 12 deletions

View File

@ -15,15 +15,15 @@ fi
if [ -z ${GIT_BRANCH+x} ] && [ -z ${APPVEYOR_REPO_BRANCH+x} ]; then if [ -z ${GIT_BRANCH+x} ] && [ -z ${APPVEYOR_REPO_BRANCH+x} ]; then
current_branch=$(git symbolic-ref HEAD | sed 's!refs\/heads\/!!') current_branch=$(git symbolic-ref HEAD | sed 's!refs\/heads\/!!')
else else
if [ -z ${GIT_BRANCH+x} ]; then current_branch="unknown"
echo "Setting to APPVEYOR_REPO_BRANCH" if [ ! -z ${GIT_BRANCH+x} ]; then
current_branch=$APPVEYOR_REPO_BRANCH
elif [ -z ${APPVEYOR_REPO_BRANCH+x} ]; then
current_branch="unknown"
else
echo "Setting to GIT_BRANCH" echo "Setting to GIT_BRANCH"
current_branch=$(echo $GIT_BRANCH | cut -d / -f 2) current_branch=$(echo $GIT_BRANCH | cut -d / -f 2)
fi fi
if [ ! -z ${APPVEYOR_REPO_BRANCH+x} ]; then
echo "Setting to APPVEYOR_REPO_BRANCH"
current_branch=$APPVEYOR_REPO_BRANCH
fi
fi fi
if [ -z ${current_branch+x} ]; then if [ -z ${current_branch+x} ]; then

View File

@ -25,15 +25,15 @@ fi
if [ -z ${GIT_BRANCH+x} ] && [ -z ${APPVEYOR_REPO_BRANCH+x} ]; then if [ -z ${GIT_BRANCH+x} ] && [ -z ${APPVEYOR_REPO_BRANCH+x} ]; then
current_branch=$(git symbolic-ref HEAD | sed 's!refs\/heads\/!!') current_branch=$(git symbolic-ref HEAD | sed 's!refs\/heads\/!!')
else else
if [ -z ${GIT_BRANCH+x} ]; then current_branch="unknown"
echo "Setting to APPVEYOR_REPO_BRANCH" if [ ! -z ${GIT_BRANCH+x} ]; then
current_branch=$APPVEYOR_REPO_BRANCH
elif [ -z ${APPVEYOR_REPO_BRANCH+x} ]; then
current_branch="unknown"
else
echo "Setting to GIT_BRANCH" echo "Setting to GIT_BRANCH"
current_branch=$(echo $GIT_BRANCH | cut -d / -f 2) current_branch=$(echo $GIT_BRANCH | cut -d / -f 2)
fi fi
if [ ! -z ${APPVEYOR_REPO_BRANCH+x} ]; then
echo "Setting to APPVEYOR_REPO_BRANCH"
current_branch=$APPVEYOR_REPO_BRANCH
fi
fi fi
# If we're on a branch, add the branch name to the app name. # If we're on a branch, add the branch name to the app name.