brew-tap-readme: make an internal command.
This commit is contained in:
parent
8b6978b54d
commit
3b8a6c0724
@ -1,31 +0,0 @@
|
|||||||
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 <formula>`.
|
|
||||||
|
|
||||||
If the formula conflicts with one from Homebrew/homebrew or another tap, you can `brew install homebrew/#{name}/<formula>`.
|
|
||||||
|
|
||||||
You can also install via URL:
|
|
||||||
|
|
||||||
```
|
|
||||||
brew install https://raw.githubusercontent.com/Homebrew/homebrew-#{name}/master/<formula>.rb
|
|
||||||
```
|
|
||||||
|
|
||||||
Docs
|
|
||||||
----
|
|
||||||
`brew help`, `man brew`, or the Homebrew [wiki][].
|
|
||||||
|
|
||||||
[wiki]:http://wiki.github.com/Homebrew/homebrew
|
|
||||||
EOS
|
|
||||||
|
|
||||||
puts template if ARGV.verbose?
|
|
||||||
path = Pathname.new('./README.md')
|
|
||||||
raise "#{path} already exists" if path.exist?
|
|
||||||
path.write template
|
|
||||||
35
Library/Homebrew/cmd/tap-readme.rb
Executable file
35
Library/Homebrew/cmd/tap-readme.rb
Executable file
@ -0,0 +1,35 @@
|
|||||||
|
module Homebrew
|
||||||
|
def tap_readme
|
||||||
|
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 <formula>`.
|
||||||
|
|
||||||
|
If the formula conflicts with one from Homebrew/homebrew or another tap, you can `brew install homebrew/#{name}/<formula>`.
|
||||||
|
|
||||||
|
You can also install via URL:
|
||||||
|
|
||||||
|
```
|
||||||
|
brew install https://raw.githubusercontent.com/Homebrew/homebrew-#{name}/master/<formula>.rb
|
||||||
|
```
|
||||||
|
|
||||||
|
Docs
|
||||||
|
----
|
||||||
|
`brew help`, `man brew`, or the Homebrew [wiki][].
|
||||||
|
|
||||||
|
[wiki]:http://wiki.github.com/Homebrew/homebrew
|
||||||
|
EOS
|
||||||
|
|
||||||
|
puts template if ARGV.verbose?
|
||||||
|
path = Pathname.new('./README.md')
|
||||||
|
raise "#{path} already exists" if path.exist?
|
||||||
|
path.write template
|
||||||
|
end
|
||||||
|
end
|
||||||
Loading…
x
Reference in New Issue
Block a user