Skip to content

Instantly share code, notes, and snippets.

@sherakama
Created August 21, 2015 23:39
Show Gist options
  • Save sherakama/c594289a5f408abded47 to your computer and use it in GitHub Desktop.
Save sherakama/c594289a5f408abded47 to your computer and use it in GitHub Desktop.
brew install drush 7.0-dev
require File.expand_path("/usr/local/Library/Taps/homebrew/homebrew-php/Requirements/php-meta-requirement", __FILE__)
class Drush < Formula
desc "A command-line shell and scripting interface for Drupal"
homepage "https://github.com/drush-ops/drush"
url "https://github.com/drush-ops/drush/archive/7.x.tar.gz"
sha1 "6e648c6056a6a6d738ad5665ce842083b22e7e61"
version "7.0-dev"
head do
url "https://github.com/drush-ops/drush.git"
end
depends_on PhpMetaRequirement
depends_on "composer" => :build
depends_on "php53" if Formula["php53"].linked_keg.exist?
depends_on "php54" if Formula["php54"].linked_keg.exist?
depends_on "php55" if Formula["php55"].linked_keg.exist?
depends_on "php56" if Formula["php56"].linked_keg.exist?
def install
system "composer", "install"
prefix.install_metafiles
File.delete "drush.bat"
libexec.install Dir["*"]
(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
@sherakama
Copy link
Author

File should be saved in /usr/local/Library/Formula/drush.rb
Then run brew install drush

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment