aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorMike McQuaid2013-04-01 20:33:12 +0100
committerMike McQuaid2013-04-01 22:12:43 +0100
commit462a41887823bbf72996c2ce324c5db30f77e89a (patch)
treeb143b2e1fed7b3aec50ee11628ac2243e1e2d1aa /Library/Homebrew
parent1263b429dfa26cb3d3106ab3b7d00b5345b4d85a (diff)
downloadbrew-462a41887823bbf72996c2ce324c5db30f77e89a.tar.bz2
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.
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/formula.rb3
-rw-r--r--Library/Homebrew/formula_installer.rb2
2 files changed, 5 insertions, 0 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 1d9c1034c..2dc7d500c 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -188,6 +188,9 @@ class Formula
# are supported.
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
def caveats; nil end
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index ace3b59fa..0b94c5b62 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -111,6 +111,8 @@ class FormulaInstaller
clean
end
+ f.post_install
+
opoo "Nothing was installed to #{f.prefix}" unless f.installed?
end