Skip to content
Permalink
Browse files

Correctly interpreting symlinks

  • Loading branch information...
lorenzo committed Oct 15, 2011
1 parent 3b8ca96 commit 856b34f9f52ce2e7845bf740defe876d03a02aad
Showing with 7 additions and 8 deletions.
  1. +7 −8 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

This comment has been minimized.

Copy link
Contributor

agarzon replied Oct 21, 2011

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

@lorenzo

This comment has been minimized.

Copy link
Member Author

lorenzo replied Oct 21, 2011

Custom shells?

Please sign in to comment.
You can’t perform that action at this time.