From 9bc3e210f3df554738deb576965ea96f57c5f501 Mon Sep 17 00:00:00 2001 From: Andrew Walsh Date: Thu, 24 Nov 2022 08:59:56 -0800 Subject: [PATCH] Fix ordering of library function call and include of library #68 Fix validation bool function and turn on halt and exit flag `set -e` to guard against regression. --- pre_cache_action.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pre_cache_action.sh b/pre_cache_action.sh index 4b3ff4b..030f3b5 100755 --- a/pre_cache_action.sh +++ b/pre_cache_action.sh @@ -1,15 +1,17 @@ #!/bin/bash +set -e + +# Include library. +script_dir="$(dirname -- "$(realpath -- "${0}")")" +source "${script_dir}/lib.sh" + # Debug mode for diagnosing issues. # Setup first before other operations. debug="${4}" validate_bool "${debug}" debug 1 test ${debug} == "true" && set -x -# Include library. -script_dir="$(dirname -- "$(realpath -- "${0}")")" -source "${script_dir}/lib.sh" - # Directory that holds the cached packages. cache_dir="${1}"