From b0abd1fbf33aabd5ab623533bb768065c7b8da66 Mon Sep 17 00:00:00 2001 From: Daniel Poggenpohl Date: Fri, 1 Feb 2019 20:48:42 +0100 Subject: [PATCH 1/2] - FIX: I should call my defined functions, else they are useless --- scripts/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/build.sh b/scripts/build.sh index 5e24244d7..47f8a042b 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -84,6 +84,7 @@ function convertPathOnCygwin() { esac } +validatePreconditions enterPackerSourceDir ensureOutputStructure cleanOutputDirs From 6857e937e2ac6ce98235e0e056046248e55568f5 Mon Sep 17 00:00:00 2001 From: Daniel Poggenpohl Date: Fri, 1 Feb 2019 23:11:22 +0100 Subject: [PATCH 2/2] - FIX: That's what I get for wanting to use fancy or/and piping, back to basics (Now using explicit rc test to decide whether to quit) --- scripts/build.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index 47f8a042b..cf44e0713 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -12,8 +12,11 @@ set -e function validateToolPresence { local TOOLNAME=$1 - which ${TOOLNAME} >/dev/null || echo "${TOOLNAME} is not on the path. Exiting..." - exit 1 + which ${TOOLNAME} >/dev/null + if [ $? -ne 0 ]; then + echo "${TOOLNAME} is not on the path. Exiting..." + exit 1 + fi } # Validates that all used tools are present; exits when any is not found