summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Anderson2013-03-21 17:39:01 (GMT)
committer Greg Anderson2013-03-21 17:39:01 (GMT)
commitf79a3be37135d6baf7d4e95cc70bbe033b7a3fc1 (patch)
tree41180004745996c5f968c914f0cfef180a735c15
parent7d5dcec78dd68fb5a734543331d09909d38c4c3a (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 97de414..ebb7934 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