Base for a static organization website

cake 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/usr/bin/env bash
  2. ################################################################################
  3. #
  4. # Bake is a shell script for running CakePHP bake script
  5. #
  6. # CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  7. # Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  8. #
  9. # Licensed under The MIT License
  10. # For full copyright and license information, please see the LICENSE.txt
  11. # Redistributions of files must retain the above copyright notice.
  12. #
  13. # @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  14. # @link http://cakephp.org CakePHP(tm) Project
  15. # @package Cake.Console
  16. # @since CakePHP(tm) v 1.2.0.5012
  17. # @license http://www.opensource.org/licenses/mit-license.php MIT License
  18. #
  19. ################################################################################
  20. # Canonicalize by following every symlink of the given name recursively
  21. canonicalize() {
  22. NAME="$1"
  23. if [ -f "$NAME" ]
  24. then
  25. DIR=$(dirname -- "$NAME")
  26. NAME=$(cd -P "$DIR" > /dev/null && pwd -P)/$(basename -- "$NAME")
  27. fi
  28. while [ -h "$NAME" ]; do
  29. DIR=$(dirname -- "$NAME")
  30. SYM=$(readlink "$NAME")
  31. NAME=$(cd "$DIR" > /dev/null && cd $(dirname -- "$SYM") > /dev/null && pwd)/$(basename -- "$SYM")
  32. done
  33. echo "$NAME"
  34. }
  35. CONSOLE=$(dirname -- "$(canonicalize "$0")")
  36. APP=`pwd`
  37. exec php -q "$CONSOLE"/cake.php -working "$APP" "$@"
  38. exit