Code formatting with no functional changes
This commit is contained in:
parent
2ce1280cc0
commit
a53f201842
@ -42,11 +42,14 @@ set -o nounset # Treat unset variables as an error
|
|||||||
# RETURNS: The path to the working directory
|
# RETURNS: The path to the working directory
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
function make_working_dir {
|
function make_working_dir {
|
||||||
|
|
||||||
# the directory of the script
|
# the directory of the script
|
||||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
# the temp directory used, within $DIR
|
# 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"`
|
WORK_DIR=`mktemp -d -p "$DIR"`
|
||||||
|
|
||||||
# check if tmp dir was created
|
# check if tmp dir was created
|
||||||
@ -64,6 +67,7 @@ function make_working_dir {
|
|||||||
# RETURNS:
|
# RETURNS:
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
function clean_working_dir {
|
function clean_working_dir {
|
||||||
|
|
||||||
if [[ -d $1 ]] && expr $1 : '.*/tmp.*' ; then
|
if [[ -d $1 ]] && expr $1 : '.*/tmp.*' ; then
|
||||||
rm -rf $1
|
rm -rf $1
|
||||||
echo "Deleted temp working directory $1"
|
echo "Deleted temp working directory $1"
|
||||||
|
Reference in New Issue
Block a user