Revert "fix(vendor-gems): redirect bundler stdout to stderr"
This commit is contained in:
parent
f1f7dc151d
commit
c4d69dd2e9
@ -40,7 +40,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
ohai "bundle install --standalone"
|
ohai "bundle install --standalone"
|
||||||
safe_system_redirect_stdout_to_stderr "bundle", "install", "--standalone"
|
safe_system "bundle", "install", "--standalone"
|
||||||
|
|
||||||
ohai "bundle pristine"
|
ohai "bundle pristine"
|
||||||
safe_system "bundle", "pristine"
|
safe_system "bundle", "pristine"
|
||||||
|
@ -332,19 +332,6 @@ module Kernel
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Redirects stdout to stderr, throws exception on command failure.
|
|
||||||
def safe_system_redirect_stdout_to_stderr(cmd, *args)
|
|
||||||
return if Homebrew._system(cmd, *args) do
|
|
||||||
# Redirect stdout stream to stderr stream. This is useful to prevent
|
|
||||||
# subprocesses from writing to stdout and interfering with the intended
|
|
||||||
# output, e.g. when running a brew command with `--json` for programs
|
|
||||||
# automating brew commands.
|
|
||||||
$stdout.reopen($stderr)
|
|
||||||
end
|
|
||||||
|
|
||||||
raise ErrorDuringExecution.new([cmd, *args], status: $CHILD_STATUS)
|
|
||||||
end
|
|
||||||
|
|
||||||
def which(cmd, path = ENV["PATH"])
|
def which(cmd, path = ENV["PATH"])
|
||||||
PATH.new(path).each do |p|
|
PATH.new(path).each do |p|
|
||||||
begin
|
begin
|
||||||
|
@ -144,9 +144,7 @@ module Homebrew
|
|||||||
|
|
||||||
# for some reason sometimes the exit code lies so check the output too.
|
# for some reason sometimes the exit code lies so check the output too.
|
||||||
if bundle_check_failed || bundle_check_output.include?("Install missing gems")
|
if bundle_check_failed || bundle_check_output.include?("Install missing gems")
|
||||||
begin
|
unless system bundle, "install"
|
||||||
safe_system_redirect_stdout_to_stderr bundle, "install"
|
|
||||||
rescue ErrorDuringExecution
|
|
||||||
message = <<~EOS
|
message = <<~EOS
|
||||||
failed to run `#{bundle} install`!
|
failed to run `#{bundle} install`!
|
||||||
EOS
|
EOS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user