Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build.rb: Use CLI::Parser to parse args #7024

Merged
merged 1 commit into from Feb 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions Library/Homebrew/build.rb
Expand Up @@ -13,6 +13,7 @@
require "debrew"
require "fcntl"
require "socket"
require "cmd/install"

class Build
attr_reader :formula, :deps, :reqs
Expand Down Expand Up @@ -183,13 +184,14 @@ def fixopt(f)
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
Expand Down