forked from rho_n/hpr_generator
Fill out stub of make_working_dir function
This commit is contained in:
parent
0ed7efe93b
commit
b544687f0f
@ -41,7 +41,21 @@ set -o nounset # Treat unset variables as an error
|
|||||||
# PARAMETERS:
|
# PARAMETERS:
|
||||||
# RETURNS: The path to the working directory
|
# RETURNS: The path to the working directory
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
function make_working_dir { echo; }
|
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
|
||||||
|
WORK_DIR=`mktemp -d -p "$DIR"`
|
||||||
|
|
||||||
|
# check if tmp dir was created
|
||||||
|
if [[ ! "$WORK_DIR" || ! -d "$WORK_DIR" ]]; then
|
||||||
|
echo "Could not create temp dir"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo $WORK_DIR
|
||||||
|
}
|
||||||
|
|
||||||
#--- FUNCTION ----------------------------------------------------------------
|
#--- FUNCTION ----------------------------------------------------------------
|
||||||
# NAME: clean_working_dir
|
# NAME: clean_working_dir
|
||||||
|
Loading…
Reference in New Issue
Block a user