From 094287837c10cf18de37cb19fc43dd79a8c9ab32 Mon Sep 17 00:00:00 2001 From: Roan Horning Date: Fri, 3 Mar 2023 21:44:35 -0500 Subject: [PATCH] Put variables into local scope of the function Forgot to use the local keyword when declaring the variables. --- utils/lib_utils.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/lib_utils.sh b/utils/lib_utils.sh index cc7594e..6e3cb87 100644 --- a/utils/lib_utils.sh +++ b/utils/lib_utils.sh @@ -44,13 +44,13 @@ set -o nounset # Treat unset variables as an error function make_working_dir { # the directory of the script - DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + local DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # the temp directory used, within $DIR # omit the -p parameter to create a temporal directory in # the default location - WORK_DIR=`mktemp -d -p "$DIR"` + local WORK_DIR=`mktemp -d -p "$DIR"` # check if tmp dir was created if [[ ! "$WORK_DIR" || ! -d "$WORK_DIR" ]]; then