summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColby Swandale <me@colby.fyi>2019-04-04 21:04:45 +1100
committerColby Swandale <me@colby.fyi>2019-04-04 21:07:13 +1100
commitbe58791ff66e4b4fb97c07041184f9fcbc0e5ff8 (patch)
treee9c9ac28a420a5adc90f2b835f2e550522c82cd0
parent0223d2123d4928a70a814f7f2d83c4023e5499ef (diff)
downloadbundler-be58791ff66e4b4fb97c07041184f9fcbc0e5ff8.tar.gz
restore `sh_with_code` in gem_helper
-rw-r--r--lib/bundler/gem_helper.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/bundler/gem_helper.rb b/lib/bundler/gem_helper.rb
index 27243a9821..55f484f723 100644
--- a/lib/bundler/gem_helper.rb
+++ b/lib/bundler/gem_helper.rb
@@ -181,12 +181,14 @@ module Bundler
out
end
- def sh_with_status(cmd, &block)
+ def sh_with_code(cmd, &block)
+ cmd += " 2>&1"
+ outbuf = String.new
Bundler.ui.debug(cmd)
SharedHelpers.chdir(base) do
- outbuf = IO.popen(cmd, :err => [:child, :out], &:read)
- status = $?
- block.call(outbuf) if status.success? && block
+ outbuf = `#{cmd}`
+ status = $?.exitstatus
+ block.call(outbuf) if status.zero? && block
[outbuf, status]
end
end