Permalink
Browse files

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 #18382.
  • Loading branch information...
1 parent b014824 commit 391aa8408e4c3f7cd0706a96b8cdc403ede6776d @MikeMcQuaid MikeMcQuaid committed Apr 1, 2013
Showing with 5 additions and 0 deletions.
  1. +3 −0 Library/Homebrew/formula.rb
  2. +2 −0 Library/Homebrew/formula_installer.rb
@@ -188,6 +188,9 @@ def cached_download
# 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
@@ -111,6 +111,8 @@ def install
clean
end
+ f.post_install
+
opoo "Nothing was installed to #{f.prefix}" unless f.installed?
end

0 comments on commit 391aa84

Please sign in to comment.