diff options
| author | Christian Moritz | 2017-06-26 21:33:12 +0200 |
|---|---|---|
| committer | Christian Moritz | 2017-06-29 20:29:25 +0200 |
| commit | 495520a1f9d55712a6a0d3eae6123fda60dbaeae (patch) | |
| tree | 8e4749789b71d63d0965227ce6559aeb7d66b847 | |
| parent | 02113e2714aae818ee2c43e203137b3cd0b61ced (diff) | |
| download | brew-495520a1f9d55712a6a0d3eae6123fda60dbaeae.tar.bz2 | |
language/node: make packname detection more robust
This fixes some edge cases where verbose output from a prepublish script
could break our npm pack package name detection code by only using the
last line of the output printed by npm itself containing the desired
package name.
| -rw-r--r-- | Library/Homebrew/language/node.rb | 6 |
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 |
