Update docs/Formula-Cookbook.md
Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
This commit is contained in:
parent
87d9af7b4a
commit
5ed94c0d00
@ -752,7 +752,9 @@ The symlinks created by [`install_symlink`](https://rubydoc.brew.sh/Pathname#ins
|
||||
|
||||
### Rewriting a script shebang
|
||||
|
||||
In some cases, the formula goal is to install a script written in an interpreted language, such as Python or Perl, to be used as an executable. Homebrew provides a `rewrite_shebang` method to rewrite the shebang of a script. This replaces the original interpreter path with the one installed by Homebrew. This guarantees that the interpreter dependency was correctly installed and is present at execution time. For example, the [`icdiff` formula](https://github.com/Homebrew/homebrew-core/blob/7beae5ab57c65249403699b2b0700fbccf14e6cb/Formula/icdiff.rb#L16) uses such utility. Note that it is necessary to include the utility in the formula, for example with Python one must use `include Language::Python::Shebang`.
|
||||
Some formulae install executable scripts written in an interpreted language such as Python or Perl. Homebrew provides a `rewrite_shebang` method to rewrite the shebang of a script. This replaces a script's original interpreter path with the one installed by Homebrew and guarantees that the correct interpreter is used at execution time.
|
||||
|
||||
For example, the [`icdiff` formula](https://github.com/Homebrew/homebrew-core/blob/7beae5ab57c65249403699b2b0700fbccf14e6cb/Formula/icdiff.rb#L16) uses such utility. Note that it is necessary to include the utility in the formula, for example with Python one must use `include Language::Python::Shebang`.
|
||||
|
||||
### Handling files that should persist over formula upgrades
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user