brew/Library/Homebrew/cmd/postinstall.rb

32 lines
669 B
Ruby
Raw Normal View History

2020-11-25 17:03:23 +01:00
# typed: true
# frozen_string_literal: true
require "sandbox"
require "formula_installer"
2019-04-17 18:25:08 +09:00
require "cli/parser"
module Homebrew
2016-09-26 01:44:51 +02:00
module_function
2020-10-20 12:03:48 +02:00
sig { returns(CLI::Parser) }
def postinstall_args
Homebrew::CLI::Parser.new do
description <<~EOS
Rerun the post-install steps for <formula>.
EOS
2020-07-30 18:40:10 +02:00
2021-01-10 14:26:40 -05:00
named_args :installed_formula, min: 1
end
end
def postinstall
args = postinstall_args.parse
args.named.to_resolved_formulae.each do |f|
ohai "Postinstalling #{f}"
2020-11-18 05:37:12 +01:00
fi = FormulaInstaller.new(f, **{ debug: args.debug?, quiet: args.quiet?, verbose: args.verbose? }.compact)
fi.post_install
end
end
end