Skip to content

Commit

Permalink
Merge pull request #296 from piotrkwiecinski/copyfromcontainer
Browse files Browse the repository at this point in the history
improve nested file and directory support for copyfromcontainer
  • Loading branch information
markshust authored Aug 27, 2020
2 parents a65dd8c + 33d7d0c commit cbc6183
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 cbc6183

Please sign in to comment.