Pārlūkot izejas kodu

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 gadu atpakaļ
vecāks
revīzija
19a76d3b46
1 mainītis faili ar 3 papildinājumiem un 0 dzēšanām
  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"