2020-10-10 14:16:11 +02:00
|
|
|
# typed: false
|
2019-04-19 15:38:03 +09:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-04-13 18:16:27 +08:00
|
|
|
require "sandbox"
|
2018-05-12 13:52:40 +02:00
|
|
|
require "formula_installer"
|
2019-04-17 18:25:08 +09:00
|
|
|
require "cli/parser"
|
2015-04-13 18:16:27 +08:00
|
|
|
|
2014-06-18 22:41:47 -05:00
|
|
|
module Homebrew
|
2020-10-20 12:03:48 +02:00
|
|
|
extend T::Sig
|
|
|
|
|
2016-09-26 01:44:51 +02:00
|
|
|
module_function
|
|
|
|
|
2020-10-20 12:03:48 +02:00
|
|
|
sig { returns(CLI::Parser) }
|
2018-11-11 20:17:33 +05:30
|
|
|
def postinstall_args
|
|
|
|
Homebrew::CLI::Parser.new do
|
|
|
|
usage_banner <<~EOS
|
|
|
|
`postinstall` <formula>
|
|
|
|
|
|
|
|
Rerun the post-install steps for <formula>.
|
|
|
|
EOS
|
2020-07-30 18:40:10 +02:00
|
|
|
|
2020-03-04 17:28:15 +00:00
|
|
|
min_named :keg
|
2018-11-11 20:17:33 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-09-01 13:56:35 +01:00
|
|
|
def postinstall
|
2020-07-25 03:48:33 +02:00
|
|
|
args = postinstall_args.parse
|
2018-11-11 20:17:33 +05:30
|
|
|
|
2020-08-19 10:34:48 -04:00
|
|
|
args.named.to_resolved_formulae.each do |f|
|
2017-05-03 09:00:17 +01:00
|
|
|
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)
|
2018-05-12 13:52:40 +02:00
|
|
|
fi.post_install
|
2015-04-13 18:16:27 +08:00
|
|
|
end
|
2013-09-01 13:56:35 +01:00
|
|
|
end
|
|
|
|
end
|