Skip to content
Permalink
Browse files

Adding symlink support to the cake console executable

  • Loading branch information...
lorenzo committed Oct 15, 2011
1 parent 6d9b709 commit 36fa2e87b4b2a0c4fd28c7e45cae89f91a37532f
Showing with 28 additions and 4 deletions.
  1. +9 −1 app/Console/cake
  2. +10 −2 lib/Cake/Console/Templates/skel/Console/cake
  3. +9 −1 lib/Cake/Console/cake
@@ -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)

This comment has been minimized.

Copy link
@tPl0ch

tPl0ch Oct 17, 2011

I think this has to be SYM=$(readlink "$LIB") (mind the double quotes), otherwise directories with whitespaces will be cut off.

This comment has been minimized.

Copy link
@lorenzo

lorenzo Oct 17, 2011

Author Member

Yeah, that was fixed in a later commit. Thanks!

LIB=$(cd $DIR && cd $(dirname -- "$SYM") && pwd)/$(basename -- "$SYM")
done

LIB=$(dirname -- "$LIB")/
APP=`pwd`

exec php -q ${LIB}cake.php -working "${APP}" "$@"
@@ -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;
@@ -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}" "$@"

0 comments on commit 36fa2e8

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