소스 검색

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"