diff options
| author | Dominyk Tiller | 2015-06-09 15:52:26 +0100 |
|---|---|---|
| committer | Dominyk Tiller | 2015-06-13 22:25:26 +0100 |
| commit | f63e7a92bb48d9a9e4e32db4d1be76e395d470d3 (patch) | |
| tree | 4ad287ddd1b771276c2d0d2eee1c77e743523e0a /Library/Homebrew/cmd | |
| parent | be9c5d5d16332ffa888853745c7792a0c8bffd9c (diff) | |
| download | brew-f63e7a92bb48d9a9e4e32db4d1be76e395d470d3.tar.bz2 | |
audit: add npm path nudge
Diffstat (limited to 'Library/Homebrew/cmd')
| -rw-r--r-- | Library/Homebrew/cmd/audit.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index 8d129cde5..c3c407f71 100644 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -489,6 +489,17 @@ class FormulaAuditor if text =~ /Formula\.factory\(/ problem "\"Formula.factory(name)\" is deprecated in favor of \"Formula[name]\"" end + + if text =~ /system "npm", "install"/ && text !~ %r[opt_libexec}/npm/bin] + need_npm = "\#{Formula[\"node\"].opt_libexec\}/npm/bin" + problem <<-EOS.undent + Please add ENV.prepend_path \"PATH\", \"#{need_npm}"\ to def install + EOS + end + + if text =~ /system "npm", "install"/ && text !~ /"HOME"/ + problem "Please add ENV[\"HOME\"] = buildpath/\".brew_home\" to def install" + end end def audit_line(line, lineno) |
