From fa05fc2451fd7598c32d76edac44c24efacd753c Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Fri, 31 May 2013 14:44:45 -0700 Subject: [PATCH] Add `brew tap-readme ` external command. Closes Homebrew/homebrew#17935. --- Library/Contributions/cmd/brew-tap-readme.rb | 32 ++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 Library/Contributions/cmd/brew-tap-readme.rb diff --git a/Library/Contributions/cmd/brew-tap-readme.rb b/Library/Contributions/cmd/brew-tap-readme.rb new file mode 100755 index 0000000000..1aac1b06db --- /dev/null +++ b/Library/Contributions/cmd/brew-tap-readme.rb @@ -0,0 +1,32 @@ +name = ARGV.first + +raise "A name is required" if name.nil? + +template = <<-EOS +Homebrew-#{name} +=========#{'=' * name.size} + +How do I install these formulae? +-------------------------------- +Just `brew tap homebrew/#{name}` and then `brew install `. + +If the formula conflicts with one from mxcl/master or another tap, you can `brew install homebrew/#{name}/`. + +You can also install via URL: + +``` +brew install https://raw.github.com/Homebrew/homebrew-#{name}/master/.rb +``` + +Docs +---- +`brew help`, `man brew`, or the Homebrew [wiki][]. + +[wiki]:http://wiki.github.com/mxcl/homebrew +EOS + +# puts ERB.new(template, nil, '>').result(binding) +puts template if ARGV.verbose? +path = Pathname.new('./README.md') +raise "#{path} already exists" if path.exist? +path.write template