From 110fc3e649cf4a9996c8787630e7d6ad74c6a81c Mon Sep 17 00:00:00 2001 From: Richard Hidalgo Date: Wed, 25 Jan 2017 14:23:29 +0100 Subject: [PATCH] modified create project to take into account app dir existance --- bin/create-project.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/create-project.sh b/bin/create-project.sh index e350975..8e159e6 100755 --- a/bin/create-project.sh +++ b/bin/create-project.sh @@ -12,6 +12,9 @@ if [ "$#" -lt 1 ]; then exit 1 fi +#if app dir exists then backup it with timestamp +[ ! -d "$CODE_DIR" ] || mv "$CODE_DIR" "$CODE_DIR".$(date +%Y%m%d%H%M%S); + mkdir -p -- "$CODE_DIR/" chmod 777 "$CODE_DIR/" @@ -39,4 +42,4 @@ case "$1" in ;; esac -touch -- "$CODE_DIR/.gitkeep" \ No newline at end of file +touch -- "$CODE_DIR/.gitkeep"