Adding symlink support to the cake console executable

This commit is contained in:
Jose Lorenzo Rodriguez 2011-10-14 22:15:26 -04:30
parent 6d9b709c7a
commit 36fa2e87b4
3 changed files with 28 additions and 4 deletions

View file

@ -17,7 +17,15 @@
# @license MIT License (http://www.opensource.org/licenses/mit-license.php)
#
################################################################################
LIB=${0/%cake/}
LIB=$(cd -P -- "$(dirname -- "$0")" && pwd -P) && LIB=$LIB/$(basename -- "$0")
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}" "$@"

View file

@ -17,9 +17,17 @@
# @license MIT License (http://www.opensource.org/licenses/mit-license.php)
#
################################################################################
LIB=${0/%cake/}
LIB=$(cd -P -- "$(dirname -- "$0")" && pwd -P) && LIB=$LIB/$(basename -- "$0")
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}" "$@"
exit;
exit;

View file

@ -17,7 +17,15 @@
# @license MIT License (http://www.opensource.org/licenses/mit-license.php)
#
################################################################################
LIB=${0/%cake/}
LIB=$(cd -P -- "$(dirname -- "$0")" && pwd -P) && LIB=$LIB/$(basename -- "$0")
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}" "$@"