aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorChristian Moritz2017-06-29 20:49:29 +0200
committerChristian Moritz2017-06-30 00:55:34 +0200
commit5e00c277ce45d6af497ec135faf54571c340e704 (patch)
treee5df15af57aa7c1176a406027abf50344d13a82f /Library
parent7910e4a5b4eabe77481ba29a13090367363285f8 (diff)
downloadbrew-5e00c277ce45d6af497ec135faf54571c340e704.tar.bz2
partly revert log verbose npm pack output commit
to fix issues with shwoing npm debug output even on non-verbose install runs.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/language/node.rb5
-rw-r--r--Library/Homebrew/test/language/node_spec.rb10
2 files changed, 8 insertions, 7 deletions
diff --git a/Library/Homebrew/language/node.rb b/Library/Homebrew/language/node.rb
index 0d02a2ad0..eaadc54fc 100644
--- a/Library/Homebrew/language/node.rb
+++ b/Library/Homebrew/language/node.rb
@@ -10,9 +10,8 @@ module Language
# fed to `npm install` only symlinks are created linking back to that
# directory, consequently breaking that assumption. We require a tarball
# because npm install creates a "real" installation when fed a tarball.
- pack_cmd = "npm pack -ddd --ignore-scripts"
- ohai pack_cmd
- output = `#{pack_cmd}`
+ pack_cmd = "npm pack --ignore-scripts"
+ output = Utils.popen_read(pack_cmd)
if !$CHILD_STATUS.exitstatus.zero? || output.lines.empty?
raise "npm failed to pack #{Dir.pwd}"
end
diff --git a/Library/Homebrew/test/language/node_spec.rb b/Library/Homebrew/test/language/node_spec.rb
index a8f95fe9a..5ddbde944 100644
--- a/Library/Homebrew/test/language/node_spec.rb
+++ b/Library/Homebrew/test/language/node_spec.rb
@@ -23,10 +23,10 @@ describe Language::Node do
describe "#std_npm_install_args" do
npm_install_arg = "libexec"
- npm_pack_cmd = "npm pack -ddd --ignore-scripts"
+ npm_pack_cmd = "npm pack --ignore-scripts"
it "raises error with non zero exitstatus" do
- allow(Language::Node).to receive(:`).with(npm_pack_cmd).and_return("error msg")
+ allow(Utils).to receive(:popen_read).with(npm_pack_cmd).and_return("error msg")
allow_any_instance_of(Process::Status).to receive(:exitstatus).and_return(42)
allow_any_instance_of(nil::NilClass).to receive(:exitstatus).and_return(42)
expect { subject.std_npm_install_args(npm_install_arg) }.to \
@@ -34,13 +34,15 @@ describe Language::Node do
end
it "raises error with empty npm pack output" do
- allow(Language::Node).to receive(:`).with(npm_pack_cmd).and_return("")
+ allow(Utils).to receive(:popen_read).with(npm_pack_cmd).and_return("")
+ allow_any_instance_of(Process::Status).to receive(:exitstatus).and_return(0)
+ allow_any_instance_of(nil::NilClass).to receive(:exitstatus).and_return(0)
expect { subject.std_npm_install_args(npm_install_arg) }.to \
raise_error("npm failed to pack #{Dir.pwd}")
end
it "does not raise error with a zero exitstatus" do
- allow(Language::Node).to receive(:`).with(npm_pack_cmd).and_return("pack.tgz")
+ allow(Utils).to receive(:popen_read).with(npm_pack_cmd).and_return("pack.tgz")
allow_any_instance_of(Process::Status).to receive(:exitstatus).and_return(0)
allow_any_instance_of(nil::NilClass).to receive(:exitstatus).and_return(0)
resp = subject.std_npm_install_args(npm_install_arg)