Skip to content

Commit

Permalink
Fix issues with bash quoting and directories with spaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Oct 15, 2011
1 parent f81c85d commit bda8df1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions app/Console/cake
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
################################################################################
LIB=$(cd -P -- "$(dirname -- "$0")" && pwd -P) && LIB=$LIB/$(basename -- "$0")

while [ -h $LIB ]; do
while [ -h "$LIB" ]; do
DIR=$(dirname -- "$LIB")
SYM=$(readlink $LIB)
LIB=$(cd $DIR && cd $(dirname -- "$SYM") && pwd)/$(basename -- "$SYM")
SYM=$(readlink "$LIB")
LIB=$(cd "$DIR" && cd $(dirname -- "$SYM") && pwd)/$(basename -- "$SYM")
done

LIB=$(dirname -- "$LIB")/
APP=`pwd`

exec php -q ${LIB}cake.php -working "${APP}" "$@"
exec php -q "$LIB"cake.php -working "$APP" "$@"

exit;
10 changes: 5 additions & 5 deletions lib/Cake/Console/cake
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
################################################################################
LIB=$(cd -P -- "$(dirname -- "$0")" && pwd -P) && LIB=$LIB/$(basename -- "$0")

while [ -h $LIB ]; do
while [ -h "$LIB" ]; do
DIR=$(dirname -- "$LIB")
SYM=$(readlink $LIB)
LIB=$(cd $DIR && cd $(dirname -- "$SYM") && pwd)/$(basename -- "$SYM")
SYM=$(readlink "$LIB")
LIB=$(cd "$DIR" && cd $(dirname -- "$SYM") && pwd)/$(basename -- "$SYM")
done

LIB=$(dirname -- "$LIB")/
APP=`pwd`

exec php -q ${LIB}cake.php -working "${APP}" "$@"
exec php -q "$LIB"cake.php -working "$APP" "$@"

exit;
exit;

0 comments on commit bda8df1

Please sign in to comment.