hack: correctly check for empty PULL_BASE_SHA

The existing comparison fails due to the 'nounset' option being on.
That failure masks the nicely formatted error message the if message is
trying to print. This correctly prints the intended error instead of
bash's default unset behavior.
This commit is contained in:
Euan Kemp 2018-03-15 18:57:57 -07:00
parent 08df3631fa
commit 25979480d4

View File

@ -20,7 +20,7 @@ set -o pipefail
semvercompareOldVer=""
semvercompareNewVer=""
if [ "${PULL_BASE_SHA}" == "" ]; then
if [ -z "${PULL_BASE_SHA+a}" ]; then
echo "PULL_BASE_SHA must be set"
exit 1
fi
@ -31,7 +31,7 @@ fi
git fetch jetstack "${PULL_BASE_SHA}:refs/remotes/jetstack/pull-base"
SCRIPT_ROOT=$(dirname "${BASH_SOURCE}")/..
SCRIPT_ROOT="$(dirname "${BASH_SOURCE}")/.."
CHANGED_FOLDERS=`git diff --find-renames --name-only $(git merge-base jetstack/pull-base HEAD) "${SCRIPT_ROOT}/contrib/charts/" | awk -F/ '{print $1"/"$2"/"$3}' | uniq`