Переглянути джерело

Update copyfromcontainer to create src folder

It creates the src folder when copying all the code from the repo first the first time, by the src doesn't exist. 

An example is when the dev follows the README part saying to run bin/cli git clone .... to start the project.
Rafael Corrêa Gomes 1 рік тому
батько
коміт
19a76d3b46
1 змінених файлів з 3 додано та 0 видалено
  1. 3 0
      compose/bin/copyfromcontainer

+ 3 - 0
compose/bin/copyfromcontainer

@@ -2,6 +2,9 @@
 [ -z "$1" ] && echo "Please specify a directory or file to copy from container (ex. vendor, --all)" && exit
 
 REAL_SRC=$(cd -P "src" && pwd)
+if [ ! -d "$REAL_SRC" ]; then
+  mkdir -p "$REAL_SRC"
+fi
 if [ "$1" == "--all" ]; then
   docker cp "$(bin/docker-compose ps -q phpfpm|awk '{print $1}')":/var/www/html/./ "$REAL_SRC/"
   echo "Completed copying all files from container to host"