Pass args in postinstall instead of using global args.

This commit is contained in:
Markus Reiter 2020-07-26 09:45:05 +02:00
parent 3a60d50bd3
commit 8d52fa909f

View File

@ -10,13 +10,13 @@ require "cli/parser"
require "cmd/postinstall"
begin
Homebrew.postinstall_args.parse
args = Homebrew.postinstall_args.parse
error_pipe = UNIXSocket.open(ENV["HOMEBREW_ERROR_PIPE"], &:recv_io)
error_pipe.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)
trap("INT", old_trap)
formula = Homebrew.args.resolved_formulae.first
formula = args.resolved_formulae.first
formula.extend(Debrew::Formula) if Homebrew.args.debug?
formula.run_post_install
rescue Exception => e # rubocop:disable Lint/RescueException