Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

1.3: Added resolution of symbolic links in cake CLI bash script. #232

Closed
wants to merge 4 commits into from

2 participants

@tPl0ch

Added resolution of symbolic links in cake CLI bash script. Now works when either being linked to '/usr/bin/cake2' or called from PATH, which makes having executables for 1.2, 1.3 and 2.0 linked into PATH a charm.

@lorenzo
Owner

Thanks for the idea, I had to re-do some parts in order to take in account more cases. commmited in [568308d]

@lorenzo lorenzo closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 16 additions and 7 deletions.
  1. +16 −7 cake/console/cake
View
23 cake/console/cake
@@ -10,15 +10,24 @@
# Licensed under The MIT License
# Redistributions of files must retain the above copyright notice.
#
-# @copyright Copyright 2005-2011, Cake Software Foundation, Inc.
-# @link http://cakephp.org CakePHP(tm) Project
-# @package cake
-# @subpackage cake.cake.console
-# @since CakePHP(tm) v 1.2.0.5012
-# @license MIT License (http://www.opensource.org/licenses/mit-license.php)
+# @copyright Copyright 2005-2011, Cake Software Foundation, Inc.
+# @link http://cakephp.org CakePHP(tm) Project
+# @package Cake
+# @subpackage Cake.Console
+# @since CakePHP(tm) v 1.2.0.5012
+# @license MIT License (http://www.opensource.org/licenses/mit-license.php)
#
################################################################################
-LIB=${0/%cake/}
+LIB=${0}
+SYM=$(readlink "$0")
+
+if [ ! -n "$SYM" ]
+ then
+ LIB=${LIB%/*}"/"
+ else
+ LIB=${SYM%/*}"/"
+fi
+
APP=`pwd`
exec php -q ${LIB}cake.php -working "${APP}" "$@"
Something went wrong with that request. Please try again.