From c2f1b1b6254eb3406923bddddade880b5dae2eef Mon Sep 17 00:00:00 2001 From: ABM Ruman Date: Fri, 6 Mar 2020 19:38:45 +0600 Subject: [PATCH] fix bug where `init.sh` replaces .env with example Fixes: - invoking ./scripts/init.sh replaces .env with env.example --- scripts/init.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/init.sh b/scripts/init.sh index dd0c58e..9dceaab 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -2,7 +2,14 @@ set -e echo "Copying env file" -cp env.example .env +# Create env from env.example if it doesn't exist +if [ -f ".env" ] +then + echo -e "env file exists" +else + echo -e "Copying env file" + cp env.example .env +fi echo "creating acme.json" touch acme.json