diff options
| author | Arne Jørgensen | 2013-12-15 22:42:35 +0100 |
|---|---|---|
| committer | Adam Vandenberg | 2014-02-14 07:51:57 -0800 |
| commit | 5820ef661fa79ffcc570c30bdef3c127422fb5c1 (patch) | |
| tree | 7fbb8b7ff467f1c8c94cd98d8461eb80559f0d08 /Library/Formula | |
| parent | 52373d1a311fd941a3db545795fde1e1c60e4204 (diff) | |
| download | homebrew-5820ef661fa79ffcc570c30bdef3c127422fb5c1.tar.bz2 | |
drush: added wrapper to use HOMEBREW_PREFIX.
Added a new bin wrapper script.
The purpose is to set the environment variables ETC_PREFIX and
SHARE_PREFIX - both pointing to HOMEBREW_PREFIX.
As an example drush locates site wide installed commands in
$SHARE_PREFIX/share/drush/commands. SHARE_PREFIX (and ETC_PREFIX)
defaults to /usr and hence drush will look for site wide installed
commands in /usr/share/drush/commands.
That location is outside of where Homebrew should write stuff so this
makes it impossible for other formulas to install site wide commands.
The new wrapper script sets ETC_PREFIX and
SHARE_PREFIX to point to HOMEBREW_PREFIX. And now it is possible to have
other formulas install site wide drush commands.
Closes #25245.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/drush.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Library/Formula/drush.rb b/Library/Formula/drush.rb index 7aa5929f4..d5e85a2fe 100644 --- a/Library/Formula/drush.rb +++ b/Library/Formula/drush.rb @@ -9,7 +9,14 @@ class Drush < Formula def install prefix.install_metafiles libexec.install Dir['*'] -['drush.bat'] - bin.install_symlink libexec/'drush' + (bin+'drush').write <<-EOS.undent + #!/bin/sh + + export ETC_PREFIX=${ETC_PREFIX:=#{HOMEBREW_PREFIX}} + export SHARE_PREFIX=${SHARE_PREFIX:=#{HOMEBREW_PREFIX}} + + exec "#{libexec}/drush" "$@" + EOS bash_completion.install libexec/'drush.complete.sh' => 'drush' end end |
