Add optional post_install method to Formula.

Sometimes we may want to run commands after bottle installation (such as
creating directories outside the Cellar) so this method allows us to do
so.

Closes Homebrew/homebrew#18382.
This commit is contained in:
Mike McQuaid 2013-04-01 20:33:12 +01:00
parent 1263b429df
commit 462a418878
2 changed files with 5 additions and 0 deletions

View File

@ -188,6 +188,9 @@ class Formula
# are supported. # are supported.
def pour_bottle?; true end def pour_bottle?; true end
# Can be overridden to run commands on both source and bottle installation.
def post_install; end
# tell the user about any caveats regarding this package, return a string # tell the user about any caveats regarding this package, return a string
def caveats; nil end def caveats; nil end

View File

@ -111,6 +111,8 @@ class FormulaInstaller
clean clean
end end
f.post_install
opoo "Nothing was installed to #{f.prefix}" unless f.installed? opoo "Nothing was installed to #{f.prefix}" unless f.installed?
end end