2012-03-16 00:20:39 +00:00
|
|
|
#!/usr/bin/env bash
|
2010-10-16 05:15:22 +00:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# Bake is a shell script for running CakePHP bake script
|
|
|
|
# PHP 5
|
|
|
|
#
|
|
|
|
# CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
2012-03-13 02:46:07 +00:00
|
|
|
# Copyright 2005-2012, Cake Software Foundation, Inc.
|
2010-10-16 05:15:22 +00:00
|
|
|
#
|
|
|
|
# Licensed under The MIT License
|
|
|
|
# Redistributions of files must retain the above copyright notice.
|
|
|
|
#
|
2012-06-06 06:46:00 +00:00
|
|
|
# @copyright Copyright 2005-2012, Cake Software Foundation, Inc.
|
|
|
|
# @link http://cakephp.org CakePHP(tm) Project
|
2012-12-22 23:23:01 +00:00
|
|
|
# @package cake.Console
|
|
|
|
# @since CakePHP(tm) v 1.2.0.5012
|
2012-06-06 06:46:00 +00:00
|
|
|
# @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
2010-10-16 05:15:22 +00:00
|
|
|
#
|
|
|
|
################################################################################
|
2011-10-15 02:45:26 +00:00
|
|
|
|
2012-10-25 23:12:29 +00:00
|
|
|
# Canonicalize by following every symlink of the given name recursively
|
|
|
|
canonicalize() {
|
2012-12-22 23:23:01 +00:00
|
|
|
NAME="$1"
|
|
|
|
if [ -f "$NAME" ]
|
|
|
|
then
|
|
|
|
DIR=$(dirname -- "$NAME")
|
|
|
|
NAME=$(cd -P "$DIR" && pwd -P)/$(basename -- "$NAME")
|
|
|
|
fi
|
2012-10-25 23:12:29 +00:00
|
|
|
while [ -h "$NAME" ]; do
|
|
|
|
DIR=$(dirname -- "$NAME")
|
|
|
|
SYM=$(readlink "$NAME")
|
|
|
|
NAME=$(cd "$DIR" && cd $(dirname -- "$SYM") && pwd)/$(basename -- "$SYM")
|
|
|
|
done
|
|
|
|
echo "$NAME"
|
|
|
|
}
|
2011-10-15 02:45:26 +00:00
|
|
|
|
2012-12-22 23:23:01 +00:00
|
|
|
CONSOLE=$(dirname -- "$(canonicalize "$0")")
|
|
|
|
APP=`pwd`
|
2010-10-16 05:15:22 +00:00
|
|
|
|
2012-12-22 23:23:01 +00:00
|
|
|
exec php -q "$CONSOLE"/cake.php -working "$APP" "$@"
|
|
|
|
exit
|