Fix issues with paths + spaces.

This commit is contained in:
mark_story 2012-12-19 17:35:56 -05:00
parent d16a9ab98e
commit b346227d10

View file

@ -20,10 +20,11 @@
# Canonicalize by following every symlink of the given name recursively # Canonicalize by following every symlink of the given name recursively
canonicalize() { canonicalize() {
NAME=$1 NAME="$1"
if [ -f "$NAME" ] if [ -f "$NAME" ]
then then
NAME=$(cd -P -- "$(dirname -- "$NAME")" && pwd -P)/$(basename -- "$NAME") DIR=$(dirname -- "$NAME")
NAME=$(cd -P "$DIR" && pwd -P)/$(basename -- "$NAME")
fi fi
while [ -h "$NAME" ]; do while [ -h "$NAME" ]; do
DIR=$(dirname -- "$NAME") DIR=$(dirname -- "$NAME")
@ -33,9 +34,8 @@ canonicalize() {
echo "$NAME" echo "$NAME"
} }
CONSOLE=$(dirname $(canonicalize "$0")) CONSOLE=$(dirname -- "$(canonicalize "$0")")
APP=`pwd` APP=`pwd`
exec php -q $CONSOLE/cake.php -working "$APP" "$@" exec php -q "$CONSOLE"/cake.php -working "$APP" "$@"
exit
exit;