From a53f201842efc7fd4e5f8890b5c9422a3899ab1c Mon Sep 17 00:00:00 2001 From: Roan Horning Date: Fri, 3 Mar 2023 20:46:34 -0500 Subject: [PATCH] Code formatting with no functional changes --- utils/lib_utils.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/utils/lib_utils.sh b/utils/lib_utils.sh index 906da54..cc7594e 100644 --- a/utils/lib_utils.sh +++ b/utils/lib_utils.sh @@ -42,11 +42,14 @@ set -o nounset # Treat unset variables as an error # RETURNS: The path to the working directory #------------------------------------------------------------------------------- function make_working_dir { + # the directory of the script 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 + # omit the -p parameter to create a temporal directory in + # the default location + WORK_DIR=`mktemp -d -p "$DIR"` # check if tmp dir was created @@ -64,6 +67,7 @@ function make_working_dir { # RETURNS: #------------------------------------------------------------------------------- function clean_working_dir { + if [[ -d $1 ]] && expr $1 : '.*/tmp.*' ; then rm -rf $1 echo "Deleted temp working directory $1"