Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Correctly interpreting symlinks

  • Loading branch information...
commit 856b34f9f52ce2e7845bf740defe876d03a02aad 1 parent 3b8ca96
@lorenzo lorenzo authored
Showing with 7 additions and 8 deletions.
  1. +7 −8 cake/console/cake
View
15 cake/console/cake
@@ -18,16 +18,15 @@
# @license MIT License (http://www.opensource.org/licenses/mit-license.php)
#
################################################################################
-LIB=${0}
-SYM=$(readlink "$0")
+LIB=$(cd -P -- "$(dirname -- "$0")" && pwd -P) && LIB=$LIB/$(basename -- "$0")
-if [ ! -n "$SYM" ]
- then
- LIB=${LIB%/*}"/"
- else
- LIB=${SYM%/*}"/"
-fi
+while [ -h $LIB ]; do
+ DIR=$(dirname -- "$LIB")
+ 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}" "$@"

2 comments on commit 856b34f

@agarzon

loading custom shells is not working any more since this file was changed

@lorenzo
Owner

Custom shells?

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