From f63e7a92bb48d9a9e4e32db4d1be76e395d470d3 Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Tue, 9 Jun 2015 15:52:26 +0100 Subject: [PATCH] audit: add npm path nudge --- Library/Homebrew/cmd/audit.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index 8d129cde5f..c3c407f716 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)