Skip to content
Snippets Groups Projects
Commit e60dc648 authored by Xu Cheng's avatar Xu Cheng
Browse files

only run post_install if it's defined


Closes Homebrew/homebrew#42593.

Signed-off-by: default avatarXu Cheng <xucheng@me.com>
parent 8fecd4c1
No related branches found
No related tags found
No related merge requests found
......@@ -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?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment