mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
Correctly interpreting symlinks
This commit is contained in:
parent
3b8ca96428
commit
856b34f9f5
1 changed files with 7 additions and 8 deletions
|
@ -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}" "$@"
|
||||
|
|
Loading…
Add table
Reference in a new issue