Skip to content
This repository
Browse code

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.
  • Loading branch information...
commit 70ac1c7e331fc43dceb20b8a732ab4f3152ac149 1 parent 2f7f5e1
Andy Dawson authored July 16, 2012

Showing 1 changed file with 4 additions and 2 deletions. Show diff stats Hide diff stats

  1. 6  app/Console/cake
6  app/Console/cake
@@ -17,7 +17,8 @@
17 17
 # @license      MIT License (http://www.opensource.org/licenses/mit-license.php)
18 18
 #
19 19
 ################################################################################
20  
-LIB=$(cd -P -- "$(dirname -- "$0")" && pwd -P) && LIB=$LIB/$(basename -- "$0")
  20
+ME=$(readlink -f $0)
  21
+LIB=$(cd -P -- "$(dirname -- "$ME")" && pwd -P) && LIB=$LIB/$(basename -- "$ME")
21 22
 
22 23
 while [ -h "$LIB" ]; do
23 24
 	DIR=$(dirname -- "$LIB")
@@ -26,8 +27,9 @@ while [ -h "$LIB" ]; do
26 27
 done
27 28
 
28 29
 LIB=$(dirname -- "$LIB")/
29  
-APP=$(dirname $(cd $(dirname $0) && pwd))
  30
+APP=$(dirname $(cd $(dirname $ME) && pwd))
30 31
 
  32
+echo $APP
31 33
 exec php -q "$LIB"cake.php -working "$APP" "$@"
32 34
 
33 35
 exit;

0 notes on commit 70ac1c7

Please sign in to comment.
Something went wrong with that request. Please try again.