From 63115111170d042fbf6728e0f0152e0b7a838f60 Mon Sep 17 00:00:00 2001 From: "Santiago M. Mola" Date: Wed, 15 Jul 2020 18:37:19 +0200 Subject: [PATCH] avoid using realpath in scripts scripts/run uses realpath when COMPOSE_FILE is set. realpath is not available in some systems (e.g. macOS), and readlink -f isn't either. Replaced with a more portable approach. Signed-off-by: Santiago M. Mola --- script/run/run.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/script/run/run.sh b/script/run/run.sh index a6de02f73..8bc6798f3 100755 --- a/script/run/run.sh +++ b/script/run/run.sh @@ -36,7 +36,10 @@ if [ "$(pwd)" != '/' ]; then fi if [ -n "$COMPOSE_FILE" ]; then COMPOSE_OPTIONS="$COMPOSE_OPTIONS -e COMPOSE_FILE=$COMPOSE_FILE" - compose_dir=$(realpath "$(dirname "$COMPOSE_FILE")") + compose_dir="$(dirname "$COMPOSE_FILE")" + # canonicalize dir, do not use realpath or readlink -f + # since they are not available in some systems (e.g. macOS). + compose_dir="$(cd "$compose_dir" && pwd)" fi if [ -n "$COMPOSE_PROJECT_NAME" ]; then COMPOSE_OPTIONS="-e COMPOSE_PROJECT_NAME $COMPOSE_OPTIONS"