Skip to content

Commit

Permalink
Adding symlink resolution to app/Console/cake
Browse files Browse the repository at this point in the history
Otherwise, if you symlink to app/Console/cake the app path gets set to 2
folders above wherever the symlink is defined.
  • Loading branch information
AD7six committed Jul 16, 2012
1 parent 2f7f5e1 commit 70ac1c7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/Console/cake
Expand Up @@ -17,7 +17,8 @@
# @license MIT License (http://www.opensource.org/licenses/mit-license.php) # @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 while [ -h "$LIB" ]; do
DIR=$(dirname -- "$LIB") DIR=$(dirname -- "$LIB")
Expand All @@ -26,8 +27,9 @@ while [ -h "$LIB" ]; do
done done


LIB=$(dirname -- "$LIB")/ 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" "$@" exec php -q "$LIB"cake.php -working "$APP" "$@"


exit; exit;

0 comments on commit 70ac1c7

Please sign in to comment.