From 54343a813643f0aea73e2e0ef807a0c7c324a9d1 Mon Sep 17 00:00:00 2001 From: tangzz98 Date: Wed, 22 Mar 2023 00:45:38 -0400 Subject: [PATCH] Check if .env directory exists --- touch_env.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/touch_env.sh b/touch_env.sh index 6224a384..c446c5a5 100755 --- a/touch_env.sh +++ b/touch_env.sh @@ -14,6 +14,13 @@ if [ $1 ] && [ $1 = --gitee ]; then fi env_dir=$HOME/.env +if [ -d $env_dir ]; then + read -p '.env directory already exists. Would you like to remove and recreate .env directory? (Y/N) ' option + if [[ "$option" =~ [Yy*] ]]; then + rm -rf $env_dir + fi +fi + if ! [ -d $env_dir ]; then package_url=${RTT_PACKAGE_URL:-$DEFAULT_RTT_PACKAGE_URL} mkdir $env_dir