From 9452d5e1b6d0eec733b00e091933d51c10bd460e Mon Sep 17 00:00:00 2001 From: Brian Porter Date: Mon, 19 May 2014 11:05:28 -0500 Subject: [PATCH] Harden the `bin/cake` script to avoid breakage when local shell environment has a `CDPATH` set. --- lib/Cake/Console/cake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Cake/Console/cake b/lib/Cake/Console/cake index 3bdf2281d..a3b4ba791 100755 --- a/lib/Cake/Console/cake +++ b/lib/Cake/Console/cake @@ -24,12 +24,12 @@ canonicalize() { if [ -f "$NAME" ] then DIR=$(dirname -- "$NAME") - NAME=$(cd -P "$DIR" && pwd -P)/$(basename -- "$NAME") + NAME=$(cd -P "$DIR" > /dev/null && pwd -P)/$(basename -- "$NAME") fi while [ -h "$NAME" ]; do DIR=$(dirname -- "$NAME") SYM=$(readlink "$NAME") - NAME=$(cd "$DIR" && cd $(dirname -- "$SYM") && pwd)/$(basename -- "$SYM") + NAME=$(cd "$DIR" > /dev/null && cd $(dirname -- "$SYM") > /dev/null && pwd)/$(basename -- "$SYM") done echo "$NAME" }