From ee6a4e601d95b41336b7e5e34c19e43c88629e1c Mon Sep 17 00:00:00 2001 From: Roan Horning Date: Mon, 27 Feb 2023 23:30:24 -0500 Subject: [PATCH] Fill out function clean_working_dir --- utils/lib_utils.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/utils/lib_utils.sh b/utils/lib_utils.sh index 52fad3f..6667798 100644 --- a/utils/lib_utils.sh +++ b/utils/lib_utils.sh @@ -60,10 +60,18 @@ function make_working_dir { #--- FUNCTION ---------------------------------------------------------------- # NAME: clean_working_dir # DESCRIPTION: Remove local temporary working directory -# PARAMETERS: +# PARAMETERS: WORK_DIR -- Temporay directory to be delted # RETURNS: #------------------------------------------------------------------------------- -function clean_working_dir { echo; } +function clean_working_dir { + if [[ -d $1 ]] && expr $1 : '.*/tmp.*' ; then + rm -rf $1 + echo "Deleted temp working directory $1" + else + echo "Not a temporary directory: $1" + fi + +} #--- FUNCTION ---------------------------------------------------------------- # NAME: download_hpr_sql