aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominyk Tiller2015-06-09 15:52:26 +0100
committerDominyk Tiller2015-06-13 22:25:26 +0100
commitf63e7a92bb48d9a9e4e32db4d1be76e395d470d3 (patch)
tree4ad287ddd1b771276c2d0d2eee1c77e743523e0a
parentbe9c5d5d16332ffa888853745c7792a0c8bffd9c (diff)
downloadbrew-f63e7a92bb48d9a9e4e32db4d1be76e395d470d3.tar.bz2
audit: add npm path nudge
-rw-r--r--Library/Homebrew/cmd/audit.rb11
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)