Skip to content

Commit

Permalink
Harden the bin/cake script to avoid breakage when local shell envir…
Browse files Browse the repository at this point in the history
…onment has a `CDPATH` set.
  • Loading branch information
beporter committed May 19, 2014
1 parent 0fd12c7 commit 9452d5e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Cake/Console/cake
Expand Up @@ -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"
}
Expand Down

0 comments on commit 9452d5e

Please sign in to comment.