Browse Source

Fix: Prevent CDPATH from corrupting directory paths in copy scripts

Cas Ebbers 1 month ago
parent
commit
918cc9689c
2 changed files with 2 additions and 2 deletions
  1. 1 1
      compose/bin/copyfromcontainer
  2. 1 1
      compose/bin/copytocontainer

+ 1 - 1
compose/bin/copyfromcontainer

@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 [ -z "$1" ] && echo "Please specify a directory or file to copy from container (ex. vendor, --all)" && exit
 
-REAL_SRC=$(cd -P "src" && pwd)
+REAL_SRC=$(cd -P "src" >/dev/null && pwd)
 if [ ! -d "$REAL_SRC" ]; then
   mkdir -p "$REAL_SRC"
 fi

+ 1 - 1
compose/bin/copytocontainer

@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 [ -z "$1" ] && echo "Please specify a directory or file to copy to container (ex. vendor, --all)" && exit
 
-REAL_SRC=$(cd -P "src" && pwd)
+REAL_SRC=$(cd -P "src" >/dev/null && pwd)
 if [ "$1" == "--all" ]; then
   docker cp "$REAL_SRC/./" "$(bin/docker-compose ps -q phpfpm|awk '{print $1}')":/var/www/html/
   echo "Completed copying all files from host to container"