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:
parent
1263b429df
commit
462a418878
@ -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
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user