-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"