# PHP error logfile to set error_log to
PHP_ERRORLOG=logs/php.log
-# Get dir, but make it absolute
-cd "$1"
-DIR=`pwd`
-
+# Get dir
+DIR="$1"
-if [ -e "$DIR" -a ! -d "$DIR" ]; then
- echo "$DIR" must be a directory, or not exist yet.
- exit 1;
+if [ -e "$DIR" ]; then
+ if [ ! -d "$DIR" ]; then
+ echo "$DIR" must be a directory, or not exist yet.
+ exit 1;
+ fi
+ echo "Skipping creation of $DIR, it already exists";
+else
+ # Create $DIR from $TEMPLATE_DIR, if it does not exist yet
+ echo "Creating $DIR from $TEMPLATE_DIR"
+ cp -R "$TEMPLATE_DIR" "$DIR"
fi
+# Make $DIR absolute
+cd "$DIR"
+DIR=`pwd`
+
# Strip prefix
SITE=`basename $DIR`
exit 1
fi
-if [ -e "$DIR" ]; then
- echo "Skipping creation of $DIR, it already exists";
-else
- # Create $DIR from $TEMPLATE_DIR, if it does not exist yet
- echo "Creating $DIR from $TEMPLATE_DIR"
- cp -R "$TEMPLATE_DIR" "$DIR"
-fi
-
echo "Setting up permissions"
# Set up permissions
sudo chown -R 0:$GROUP "$DIR"