Skip to content

Commit

Permalink
improve nested file and directory support for copyfromcontainer
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrkwiecinski committed Aug 8, 2020
1 parent a65dd8c commit 33d7d0c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion compose/bin/copyfromcontainer
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ if [ "$1" == "--all" ]; then
docker cp $(docker-compose ps -q phpfpm|awk '{print $1}'):/var/www/html/./ $REAL_SRC/
echo "Completed copying all files from container to host"
else
docker cp $(docker-compose ps -q phpfpm|awk '{print $1}'):/var/www/html/$1 $REAL_SRC/
if [ -f "$1" ] ; then
docker cp $(docker-compose ps -q phpfpm|awk '{print $1}'):/var/www/html/$1 $REAL_SRC/$1
else
docker cp $(docker-compose ps -q phpfpm|awk '{print $1}'):/var/www/html/$1 $REAL_SRC/$(dirname $1)
fi
echo "Completed copying $1 from container to host"
fi

0 comments on commit 33d7d0c

Please sign in to comment.