Merge pull request #7024 from GauthamGoli/build-args-fix

build.rb: Use CLI::Parser to parse args
This commit is contained in:
Gautham Goli 2020-02-12 02:18:05 +05:30 committed by GitHub
commit e7fd14dc30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,6 +13,7 @@ require "extend/ENV"
require "debrew"
require "fcntl"
require "socket"
require "cmd/install"
class Build
attr_reader :formula, :deps, :reqs
@ -183,13 +184,14 @@ class Build
end
begin
Homebrew.install_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 = ARGV.formulae.first
options = Options.create(ARGV.flags_only)
formula = Homebrew.args.formulae.first
options = Options.create(Homebrew.args.flags_only)
build = Build.new(formula, options)
build.install
rescue Exception => e # rubocop:disable Lint/RescueException