Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 391aa8408e4c3f7cd0706a96b8cdc403ede6776d 1 parent b014824
@mikemcquaid mikemcquaid authored
View
3  Library/Homebrew/formula.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
View
2  Library/Homebrew/formula_installer.rb
@@ -111,6 +111,8 @@ def install
clean
end
+ f.post_install
+
opoo "Nothing was installed to #{f.prefix}" unless f.installed?
end
Please sign in to comment.
Something went wrong with that request. Please try again.