summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Anderson2013-03-21 17:39:01 (GMT)
committer Greg Anderson2013-03-21 17:39:40 (GMT)
commit3e04a7ae312c80cf0b3e14d554d6419ec5b192d9 (patch)
tree721ef3673876564af1ddd03fda82508c8ca59521
parentd8e9ad162e5cfadffe9b7e6459ec2846d3c153dd (diff)
Issue #1948584 by greg.1.anderson: fix bug introduced by #1939982, that breaks drush on MinGW and some non-bash shells
-rwxr-xr-xdrush22
1 files changed, 13 insertions, 9 deletions
diff --git a/drush b/drush
index a8c93c3..17f6d2f 100755
--- a/drush
+++ b/drush
@@ -55,18 +55,22 @@ if [ -n "$DRUSH_PHP" ] ; then
# Use the DRUSH_PHP environment variable if it is available.
php="$DRUSH_PHP"
else
- # Default to using the php that we find on the PATH.
- # We check for a command line (cli) version of php, and if found use that.
- # Note that we need the full path to php here for Dreamhost, which behaves oddly. See http://drupal.org/node/662926
- php="$(which php-cli php 2>/dev/null | head -1)"
-
- if [ ! -x "$php" ]; then
- echo "ERROR: can't find php."; exit 1
- fi
-
# On MSYSGIT, we need to use "php", not the full path to php
if [ -n "$MINGW" ] ; then
php="php"
+ else
+ # Default to using the php that we find on the PATH.
+ # We check for a command line (cli) version of php, and if found use that.
+ # Note that we need the full path to php here for Dreamhost, which behaves oddly. See http://drupal.org/node/662926
+ php="`which php-cli 2>/dev/null`"
+
+ if [ ! -x "$php" ]; then
+ php="`which php 2>/dev/null`"
+ fi
+
+ if [ ! -x "$php" ]; then
+ echo "ERROR: can't find php."; exit 1
+ fi
fi
fi