docs: mention that bin.install can rename file

This commit is contained in:
Caleb Xu 2020-05-19 00:34:24 -04:00 committed by GitHub
parent 9de07eaf8f
commit 1cd5d508a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -411,6 +411,12 @@ system "make", "install"
Youll see stuff like this in some formulae. This moves the file `foo` into the formulas `bin` directory (`/usr/local/Cellar/pkg/0.1/bin`) and makes it executable (`chmod 0555 foo`).
You can also rename the file during the installation process. This can be useful for adding a prefix to binaries that would otherwise cause conflicts with another formula, or for removing a file extension. For example, to install `foo.py` into the formula's `bin` directory (`/usr/local/Cellar/pkg/0.1/bin`) as just `foo` instead of `foo.py`:
```ruby
bin.install "foo.py" => "foo"
```
### `inreplace`
[`inreplace`](https://rubydoc.brew.sh/Utils/Inreplace) is a convenience function that can edit files in-place. For example: