only run post_install if it's defined
Closes Homebrew/homebrew#42593. Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
parent
8fecd4c198
commit
e60dc64828
@ -2,7 +2,7 @@ require "sandbox"
|
||||
|
||||
module Homebrew
|
||||
def postinstall
|
||||
ARGV.resolved_formulae.each { |f| run_post_install(f) }
|
||||
ARGV.resolved_formulae.select(&:post_install_defined?).each { |f| run_post_install(f) }
|
||||
end
|
||||
|
||||
def run_post_install(formula)
|
||||
|
||||
@ -400,11 +400,13 @@ class FormulaInstaller
|
||||
link(keg)
|
||||
fix_install_names(keg)
|
||||
|
||||
if build_bottle? && formula.post_install_defined?
|
||||
ohai "Not running post_install as we're building a bottle"
|
||||
puts "You can run it manually using `brew postinstall #{formula.full_name}`"
|
||||
else
|
||||
post_install
|
||||
if formula.post_install_defined?
|
||||
if build_bottle?
|
||||
ohai "Not running post_install as we're building a bottle"
|
||||
puts "You can run it manually using `brew postinstall #{formula.full_name}`"
|
||||
else
|
||||
post_install
|
||||
end
|
||||
end
|
||||
|
||||
ohai "Summary" if verbose? || show_summary_heading?
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user