From e0e7e155f2c1321223d6c7df17663f666d69757b Mon Sep 17 00:00:00 2001 From: Piotr Kwiecinski Date: Sat, 8 Aug 2020 20:05:31 +0100 Subject: [PATCH] Handle nested files in copytocontainer script --- compose/bin/copytocontainer | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compose/bin/copytocontainer b/compose/bin/copytocontainer index c3f289724..211d3d68b 100755 --- a/compose/bin/copytocontainer +++ b/compose/bin/copytocontainer @@ -8,7 +8,11 @@ if [ "$1" == "--all" ]; then bin/fixowns bin/fixperms else - docker cp $REAL_SRC/$1 $(docker-compose ps -q phpfpm|awk '{print $1}'):/var/www/html/ + if [ -f "$REAL_SRC/$1" ]; then + docker cp $REAL_SRC/$1 $(docker-compose ps -q phpfpm|awk '{print $1}'):/var/www/html/$1 + else + docker cp $REAL_SRC/$1 $(docker-compose ps -q phpfpm|awk '{print $1}'):/var/www/html/$(dirname $1) + fi echo "Completed copying $1 from host to container" bin/fixowns $1 bin/fixperms $1