Răsfoiți Sursa

Adds a check to ensure that the directory does not already exist in the project directory (#1127)

Co-authored-by: Mark Shust <mark@shust.com>
Jenyamba 1 an în urmă
părinte
comite
ed401d39a4
2 a modificat fișierele cu 11 adăugiri și 0 ștergeri
  1. 5 0
      compose/bin/download
  2. 6 0
      lib/template

+ 5 - 0
compose/bin/download

@@ -10,6 +10,11 @@ NC='\033[0m' # No Color
 
 bin/stop
 
+if [ -d "./bin" ]; then
+  echo "Error: The current directory is not empty. Please remove all contents within this directory and try again."
+  exit 1
+fi
+
 bin/start --no-dev
 [ $? != 0 ] && echo "Failed to start Docker services" && exit
 

+ 6 - 0
lib/template

@@ -3,6 +3,12 @@ git init -qqq
 git remote add origin https://github.com/markshust/docker-magento
 git fetch origin -qqq
 git checkout origin/master -- compose
+
+if [ -d "./bin" ]; then
+  echo "Error: The current directory is not empty. Please remove all contents within this directory and try again."
+  exit 1
+fi
+
 mv compose/* ./
 mv compose/.gitignore ./
 mv compose/.vscode ./