When running in FreeBSD, drush generates an error because the script tries to launch php-cli
when it doesn't exist. This problem occurs because drush relies on `bash` behaviour, but it calls its shell as #!/bin/sh
.
To be clear: drush *is* a Bourne shell script, but it depends on behaviour that works in Bash's implementation of Bourne shell in the way it determines the location of the PHP binary it will use.
The problem was described in http://drupal.org/node/1916326 but the two workarounds offered there were (1) to force an unnecessary dependency on bash, and (2) to avoid the problematic code by statically configuring $DRUSH_PHP
prior to running drush. While these are reasonable as workarounds, neither of them is a solution to the core problem.
The attached patch fixes this problem in FreeBSD, and also works in Linux and OSX machines I tested it on.
Comment | File | Size | Author |
---|---|---|---|
drush-7.x-5.x-freebsd.patch | 813 bytes | ghoti |
Comments
Comment #1
ghoti CreditAttribution: ghoti commentedComment #2
greg.1.anderson CreditAttribution: greg.1.anderson commentedNice. Committed to 8.x-6.x and 7.x-5.x.
Comment #3
greg.1.anderson CreditAttribution: greg.1.anderson commentedThis broke MinGW on Windows. Please see follow up at #1948584: Drush 6.0-dev does not work in MINGW32 on Windows 7. If the committed change breaks on FreeBSD, plrease re-open that issue.