Adding symlink resolution to app/Console/cake

Otherwise, if you symlink to app/Console/cake the app path gets set to 2
folders above wherever the symlink is defined.
This commit is contained in:
AD7six 2012-07-16 16:54:02 +02:00
parent 2f7f5e1322
commit 70ac1c7e33

View file

@ -17,7 +17,8 @@
# @license MIT License (http://www.opensource.org/licenses/mit-license.php)
#
################################################################################
LIB=$(cd -P -- "$(dirname -- "$0")" && pwd -P) && LIB=$LIB/$(basename -- "$0")
ME=$(readlink -f $0)
LIB=$(cd -P -- "$(dirname -- "$ME")" && pwd -P) && LIB=$LIB/$(basename -- "$ME")
while [ -h "$LIB" ]; do
DIR=$(dirname -- "$LIB")
@ -26,8 +27,9 @@ while [ -h "$LIB" ]; do
done
LIB=$(dirname -- "$LIB")/
APP=$(dirname $(cd $(dirname $0) && pwd))
APP=$(dirname $(cd $(dirname $ME) && pwd))
echo $APP
exec php -q "$LIB"cake.php -working "$APP" "$@"
exit;