File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22[ -z " $1 " ] && echo " Please specify a directory or file to copy from container (ex. vendor, --all)" && exit
33
4+ CONTAINER_ID=$( bin/docker-compose ps -q phpfpm | awk ' {print $1}' )
45REAL_SRC=$( cd -P " src" > /dev/null && pwd)
56if [ ! -d " $REAL_SRC " ]; then
67 mkdir -p " $REAL_SRC "
78fi
9+
810if [ " $1 " == " --all" ]; then
9- docker cp " $( bin/docker-compose ps -q phpfpm | awk ' {print $1} ' ) " :/var/www/html/./ " $REAL_SRC /"
11+ docker cp " $CONTAINER_ID " :/var/www/html/./ " $REAL_SRC /"
1012 echo " Completed copying all files from container to host"
1113else
1214 if [ -f " $1 " ] ; then
13- docker cp " $( bin/docker-compose ps -q phpfpm | awk ' {print $1} ' ) " :/var/www/html/" $1 " " $REAL_SRC /$1 "
15+ docker cp " $CONTAINER_ID " :/var/www/html/" $1 " " $REAL_SRC /$1 "
1416 else
15- docker cp " $( bin/docker-compose ps -q phpfpm | awk ' {print $1} ' ) " :/var/www/html/" $1 " " $REAL_SRC /$( dirname " $1 " ) "
17+ docker cp " $CONTAINER_ID " :/var/www/html/" $1 " " $REAL_SRC /$( dirname " $1 " ) "
1618 fi
1719 echo " Completed copying $1 from container to host"
1820fi
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22[ $# -eq 0 ] && echo " Please specify one or more directories/files to copy to container (ex. vendor, --all)" && exit 1
33
4- REAL_SRC=$( cd -P " src" > /dev/null && pwd)
54CONTAINER_ID=$( bin/docker-compose ps -q phpfpm | awk ' {print $1}' )
5+ REAL_SRC=$( cd -P " src" > /dev/null && pwd)
66
77for ARG in " $@ " ; do
88 if [ " $ARG " == " --all" ]; then
You can’t perform that action at this time.
0 commit comments