brew/Library/Homebrew/cmd/postinstall.rb

35 lines
849 B
Ruby
Raw Permalink Normal View History

2024-04-01 09:53:38 -07:00
# typed: strict
# frozen_string_literal: true
2024-04-01 09:53:38 -07:00
require "abstract_command"
require "sandbox"
require "formula_installer"
module Homebrew
2024-04-01 09:53:38 -07:00
module Cmd
class Postinstall < AbstractCommand
cmd_args do
description <<~EOS
Rerun the post-install steps for <formula>.
EOS
2016-09-26 01:44:51 +02:00
2024-04-01 09:53:38 -07:00
named_args :installed_formula, min: 1
end
2024-04-01 09:53:38 -07:00
sig { override.void }
def run
args.named.to_resolved_formulae.each do |f|
ohai "Postinstalling #{f}"
f.install_etc_var
if f.post_install_defined?
fi = FormulaInstaller.new(f, **{ debug: args.debug?, quiet: args.quiet?, verbose: args.verbose? }.compact)
fi.post_install
else
opoo "#{f}: no `post_install` method was defined in the formula!"
end
end
end
end
end
end