Explorar o código

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 hai 1 ano
pai
achega
19a76d3b46
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  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"