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