diff options
| author | Reid Burke | 2010-06-07 15:59:12 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2010-06-30 09:02:17 -0700 |
| commit | 1a3cf9d440beb3ccc3936dcc4290435c01a7ff3c (patch) | |
| tree | 54619c5d603b7ce3aebe50c380c871509f10421d /Library/Formula | |
| parent | 3864c81d38600b5c5245b409825bfc232d73457e (diff) | |
| download | homebrew-1a3cf9d440beb3ccc3936dcc4290435c01a7ff3c.tar.bz2 | |
Install all of the npm man pages & fix "npm help"
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/npm.rb | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/Library/Formula/npm.rb b/Library/Formula/npm.rb index 3daf55f20..8d5a491b8 100644 --- a/Library/Formula/npm.rb +++ b/Library/Formula/npm.rb @@ -8,29 +8,33 @@ class Npm <Formula depends_on 'node' + def executable + <<-EOS +#!/bin/sh +exec "#{libexec}/cli.js" "$@" + EOS + end + def install - # install all the required libs in libexec - libexec.install %w[cli.js npm.js package.json doc lib man scripts] + doc.install Dir["doc/*"] + prefix.install ["LICENSE", "README.md"] - # install man pages + # install all the required libs in libexec so `npm help` will work + libexec.install Dir["*"] + + # add "npm-" prefix to man pages link them into the libexec man pages man1.mkpath - ln_s libexec+'man/npm.1', man1+'npm.1' + Dir.chdir libexec+"man" do + Dir["*"].each do |file| + if file == "npm.1" + ln_s "#{libexec}/man/#{file}", man1 + else + ln_s "#{libexec}/man/#{file}", "#{man1}/npm-#{file}" + end + end + end # install the wrapper executable (bin+"npm").write executable end - - def caveats - <<-EOS.undent - npm is still under heavy development. - Hopefully this package will help keep people up to date. - EOS - end - - def executable - <<-EOS -#!/bin/sh -exec "#{libexec}/cli.js" "$@" - EOS - end end |
