aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/language/node.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/Library/Homebrew/language/node.rb b/Library/Homebrew/language/node.rb
index 98d376766..86874e385 100644
--- a/Library/Homebrew/language/node.rb
+++ b/Library/Homebrew/language/node.rb
@@ -11,8 +11,10 @@ module Language
# directory, consequently breaking that assumption. We require a tarball
# because npm install creates a "real" installation when fed a tarball.
output = Utils.popen_read("npm pack").chomp
- raise "npm failed to pack #{Dir.pwd}" unless $CHILD_STATUS.exitstatus.zero?
- output
+ if !$CHILD_STATUS.exitstatus.zero? || output.lines.empty?
+ raise "npm failed to pack #{Dir.pwd}"
+ end
+ output.lines.last.chomp
end
def self.setup_npm_environment