aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-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)