Skip to content
This repository
Browse code

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
Mike McQuaid mikemcquaid authored
3  Library/Homebrew/formula.rb
@@ -188,6 +188,9 @@ def cached_download
188 188 # are supported.
189 189 def pour_bottle?; true end
190 190
  191 + # Can be overridden to run commands on both source and bottle installation.
  192 + def post_install; end
  193 +
191 194 # tell the user about any caveats regarding this package, return a string
192 195 def caveats; nil end
193 196
2  Library/Homebrew/formula_installer.rb
@@ -111,6 +111,8 @@ def install
111 111 clean
112 112 end
113 113
  114 + f.post_install
  115 +
114 116 opoo "Nothing was installed to #{f.prefix}" unless f.installed?
115 117 end
116 118

0 comments on commit 391aa84

Please sign in to comment.
Something went wrong with that request. Please try again.