mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Make app/Console/cake pwd insensitive on Mac OS X.
Follow up of [36e15a065b
].
This commit is contained in:
parent
83d307e545
commit
02cfacec41
3 changed files with 43 additions and 36 deletions
|
@ -17,22 +17,21 @@
|
||||||
# @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
# @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
#
|
#
|
||||||
################################################################################
|
################################################################################
|
||||||
if [[ `uname` =~ 'Darwin' ]]; then
|
|
||||||
ME=$0
|
|
||||||
else
|
|
||||||
ME=$(readlink -f $0)
|
|
||||||
fi
|
|
||||||
LIB=$(cd -P -- "$(dirname -- "$ME")" && pwd -P) && LIB=$LIB/$(basename -- "$ME")
|
|
||||||
|
|
||||||
while [ -h "$LIB" ]; do
|
# Canonicalize by following every symlink of the given name recursively
|
||||||
DIR=$(dirname -- "$LIB")
|
canonicalize() {
|
||||||
SYM=$(readlink "$LIB")
|
NAME=$1
|
||||||
LIB=$(cd "$DIR" && cd $(dirname -- "$SYM") && pwd)/$(basename -- "$SYM")
|
while [ -h "$NAME" ]; do
|
||||||
done
|
DIR=$(dirname -- "$NAME")
|
||||||
|
SYM=$(readlink "$NAME")
|
||||||
|
NAME=$(cd "$DIR" && cd $(dirname -- "$SYM") && pwd)/$(basename -- "$SYM")
|
||||||
|
done
|
||||||
|
echo "$NAME"
|
||||||
|
}
|
||||||
|
|
||||||
LIB=$(dirname -- "$LIB")/
|
CONSOLE=$(dirname $(canonicalize "$0"))
|
||||||
APP=$(dirname $(cd $(dirname $ME) && pwd))
|
APP=$(dirname "$CONSOLE")
|
||||||
|
|
||||||
exec php -q "$LIB"cake.php -working "$APP" "$@"
|
exec php -q $CONSOLE/cake.php -working "$APP" "$@"
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
|
|
|
@ -10,24 +10,28 @@
|
||||||
# Licensed under The MIT License
|
# Licensed under The MIT License
|
||||||
# Redistributions of files must retain the above copyright notice.
|
# Redistributions of files must retain the above copyright notice.
|
||||||
#
|
#
|
||||||
# @copyright Copyright 2005-2012, Cake Software Foundation, Inc.
|
# @copyright Copyright 2005-2012, Cake Software Foundation, Inc.
|
||||||
# @link http://cakephp.org CakePHP(tm) Project
|
# @link http://cakephp.org CakePHP(tm) Project
|
||||||
# @package app.Console
|
# @package app.Console
|
||||||
# @since CakePHP(tm) v 2.0
|
# @since CakePHP(tm) v 2.0
|
||||||
# @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
# @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
#
|
#
|
||||||
################################################################################
|
################################################################################
|
||||||
LIB=$(cd -P -- "$(dirname -- "$0")" && pwd -P) && LIB=$LIB/$(basename -- "$0")
|
|
||||||
|
|
||||||
while [ -h "$LIB" ]; do
|
# Canonicalize by following every symlink of the given name recursively
|
||||||
DIR=$(dirname -- "$LIB")
|
canonicalize() {
|
||||||
SYM=$(readlink "$LIB")
|
NAME=$1
|
||||||
LIB=$(cd "$DIR" && cd $(dirname -- "$SYM") && pwd)/$(basename -- "$SYM")
|
while [ -h "$NAME" ]; do
|
||||||
done
|
DIR=$(dirname -- "$NAME")
|
||||||
|
SYM=$(readlink "$NAME")
|
||||||
|
NAME=$(cd "$DIR" && cd $(dirname -- "$SYM") && pwd)/$(basename -- "$SYM")
|
||||||
|
done
|
||||||
|
echo "$NAME"
|
||||||
|
}
|
||||||
|
|
||||||
LIB=$(dirname -- "$LIB")/
|
CONSOLE=$(dirname $(canonicalize "$0"))
|
||||||
APP=`pwd`
|
APP=$(dirname "$CONSOLE")
|
||||||
|
|
||||||
exec php -q "$LIB"cake.php -working "$APP" "$@"
|
exec php -q $CONSOLE/cake.php -working "$APP" "$@"
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
|
|
|
@ -17,17 +17,21 @@
|
||||||
# @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
# @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
#
|
#
|
||||||
################################################################################
|
################################################################################
|
||||||
LIB=$(cd -P -- "$(dirname -- "$0")" && pwd -P) && LIB=$LIB/$(basename -- "$0")
|
|
||||||
|
|
||||||
while [ -h "$LIB" ]; do
|
# Canonicalize by following every symlink of the given name recursively
|
||||||
DIR=$(dirname -- "$LIB")
|
canonicalize() {
|
||||||
SYM=$(readlink "$LIB")
|
NAME=$1
|
||||||
LIB=$(cd "$DIR" && cd $(dirname -- "$SYM") && pwd)/$(basename -- "$SYM")
|
while [ -h "$NAME" ]; do
|
||||||
done
|
DIR=$(dirname -- "$NAME")
|
||||||
|
SYM=$(readlink "$NAME")
|
||||||
|
NAME=$(cd "$DIR" && cd $(dirname -- "$SYM") && pwd)/$(basename -- "$SYM")
|
||||||
|
done
|
||||||
|
echo "$NAME"
|
||||||
|
}
|
||||||
|
|
||||||
LIB=$(dirname -- "$LIB")/
|
CONSOLE=$(dirname $(canonicalize "$0"))
|
||||||
APP=`pwd`
|
APP=`pwd`
|
||||||
|
|
||||||
exec php -q "$LIB"cake.php -working "$APP" "$@"
|
exec php -q $CONSOLE/cake.php -working "$APP" "$@"
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
|
|
Loading…
Reference in a new issue