Put variables into local scope of the function
Forgot to use the local keyword when declaring the variables.
This commit is contained in:
parent
a53f201842
commit
094287837c
@ -44,13 +44,13 @@ set -o nounset # Treat unset variables as an error
|
||||
function make_working_dir {
|
||||
|
||||
# the directory of the script
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
local 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"`
|
||||
local WORK_DIR=`mktemp -d -p "$DIR"`
|
||||
|
||||
# check if tmp dir was created
|
||||
if [[ ! "$WORK_DIR" || ! -d "$WORK_DIR" ]]; then
|
||||
|
Loading…
Reference in New Issue
Block a user