diff --git a/scripts/build_test.bash b/scripts/build_test.bash index 6f346e5..56ebb3d 100755 --- a/scripts/build_test.bash +++ b/scripts/build_test.bash @@ -1,6 +1,6 @@ #!/usr/bin/env bash -source "$(dirname ${BASH_SOURCE[0]})/_shared.bash" +source "$(dirname "${BASH_SOURCE[0]}")/_shared.bash" timestamp="$(date --utc "+%Y.%m.%d")" shortsha="$(git rev-parse --short HEAD)" @@ -8,9 +8,10 @@ blacklight="$BLROOT/bin/blacklight_$timestamp-$shortsha" warn " -- building blacklight binary..." go build -o "$blacklight" "$BLROOT/src/"*.go +exitstatus=$? -if [[ -x $blacklight ]]; then - warn " -- binary built: $(basename $blacklight)" +if [[ $exitstatus == 0 && -x $blacklight ]]; then + warn " -- binary built: $(basename "$blacklight")" file "$blacklight" >&2 ls -sh "$blacklight" >&2 @@ -19,7 +20,8 @@ if [[ -x $blacklight ]]; then echo "$blacklight" else warn " -- something went wrong!" + warn " -- go exit status: $exitstatus" warn " -- binary not found at: \"$blacklight\"" - exit -1 + exit 255 fi