Skip to content

Commit fc012b9

Browse files
committed
Fix cake shell script to run properly on macos.
Fixes #3323
1 parent 1904b7a commit fc012b9

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

cake/console/cake

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,33 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
################################################################################
33
#
44
# Bake is a shell script for running CakePHP bake script
5-
# PHP versions 4 and 5
5+
# PHP 5
66
#
77
# CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
88
# Copyright 2005-2012, Cake Software Foundation, Inc.
99
#
1010
# Licensed under The MIT License
1111
# Redistributions of files must retain the above copyright notice.
1212
#
13-
# @copyright Copyright 2005-2012, Cake Software Foundation, Inc.
14-
# @link http://cakephp.org CakePHP(tm) Project
15-
# @package Cake
16-
# @subpackage Cake.Console
17-
# @since CakePHP(tm) v 1.2.0.5012
18-
# @license MIT License (http://www.opensource.org/licenses/mit-license.php)
13+
# @copyright Copyright 2005-2012, Cake Software Foundation, Inc.
14+
# @link http://cakephp.org CakePHP(tm) Project
15+
# @package cake.Console
16+
# @since CakePHP(tm) v 1.2.0.5012
17+
# @license MIT License (http://www.opensource.org/licenses/mit-license.php)
1918
#
2019
################################################################################
2120
LIB=$(cd -P -- "$(dirname -- "$0")" && pwd -P) && LIB=$LIB/$(basename -- "$0")
2221

23-
while [ -h $LIB ]; do
24-
DIR=$(dirname -- "$LIB")
25-
SYM=$(readlink $LIB)
26-
LIB=$(cd $DIR && cd $(dirname -- "$SYM") && pwd)/$(basename -- "$SYM")
22+
while [ -h "$LIB" ]; do
23+
DIR=$(dirname -- "$LIB")
24+
SYM=$(readlink "$LIB")
25+
LIB=$(cd "$DIR" && cd $(dirname -- "$SYM") && pwd)/$(basename -- "$SYM")
2726
done
2827

2928
LIB=$(dirname -- "$LIB")/
3029
APP=`pwd`
3130

32-
exec php -q ${LIB}cake.php -working "${APP}" "$@"
31+
exec php -q "$LIB"cake.php -working "$APP" "$@"
3332

34-
exit;
33+
exit;

0 commit comments

Comments
 (0)