summaryrefslogtreecommitdiff
path: root/install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'install.sh')
-rwxr-xr-xinstall.sh17
1 files changed, 9 insertions, 8 deletions
diff --git a/install.sh b/install.sh
index 243e3cc..456c4c3 100755
--- a/install.sh
+++ b/install.sh
@@ -91,6 +91,15 @@ function makeDir()
[ -z "$1" ] && return 1
local DIR=$1
local MUST_CREATE=${2:-0}
+ if [ -e "$DIR" -a ! -d "$DIR" ]; then
+ echo "$DIR exists but is no directory!"
+ echo "Aborting..."
+ return 1
+ elif [ -d $DIR -a $MUST_CREATE = 1 ]; then
+ echo "$DIR exists. Please remove it before calling install.sh!"
+ echo "Aborting..."
+ return 1
+ fi
if [ ! -e "$DIR" ]; then
mkdir -p "$DIR"
if [ $? -ne 0 ]; then
@@ -99,14 +108,6 @@ function makeDir()
return 1
fi
fi
- if [ ! -d "$DIR" ]; then
- echo "$DIR exists but is no directory!"
- echo "Aborting..."
- return 1
- elif [ -d $DIR -a $MUST_CREATE = 1 ]; then
- echo "$DIR exists. Please remove it before calling install.sh!"
- echo "Aborting..."
- fi
return 0
}