Formula-Cookbook: Recommend the in-use write_exec_script syntax

- The `bin.write_exec_script Dir[libexec/"bin/*"]` is used in core
  formulae, whereas the previously recommended syntax is not found
  at all. Let's make reality match the documentation.
- Part of https://github.com/orgs/Homebrew/projects/5?pane=issue&itemId=97021840.
This commit is contained in:
Issy Long 2025-08-02 17:56:16 +01:00
parent aecd2b3447
commit 1ae13e0d04
No known key found for this signature in database

View File

@ -1025,7 +1025,7 @@ end
* To surface one or more binaries buried in `libexec` or a macOS `.app` package, use [`write_exec_script`](https://rubydoc.brew.sh/Pathname#write_exec_script-instance_method) or [`write_jar_script`](https://rubydoc.brew.sh/Pathname#write_jar_script-instance_method):
```ruby
bin.write_exec_script (libexec/"bin").children
bin.write_exec_script Dir[libexec/"bin/*"]
bin.write_exec_script prefix/"Package.app/Contents/MacOS/package"
bin.write_jar_script libexec/jar_file, "jarfile", java_version: "11"
```