Skip to content

Commit

Permalink
Create binary.md documentation (#28822)
Browse files Browse the repository at this point in the history
* Create binary.md

Closes #25423.

* Update binary.md

* Update binary.md

* Update binary.md

* Update binary.md

* Update binary.md

* Update binary.md

* Update binary.md

* Update binary.md
  • Loading branch information
miccal authored Jan 10, 2017
1 parent 08c0fb6 commit 334f331
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions doc/cask_language_reference/stanzas/binary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# binary

In the simple case of a string argument to `binary`, the source file is linked into the `$(brew --prefix)/bin` directory (typically `/usr/local/bin`) on installation. For example (from [operadriver.rb](https://github.com/caskroom/homebrew-cask/blob/60531a2812005dd5f17dc92f3ce7419af3c5d019/Casks/operadriver.rb#L11)):

```ruby
binary 'operadriver'
```

creates a symlink to:

```bash
$(brew --prefix)/bin/operadriver
```

from a source file such as:

```bash
/usr/local/Caskroom/operadriver/0.2.2/operadriver
```

## Renaming the Target

You can rename the target which appears in your binaries directory directory by adding a `target:` key to `binary`. Behaviour and usage is [the same as with `app`](https://github.com/caskroom/homebrew-cask/blob/master/doc/cask_language_reference/stanzas/app.md#renaming-the-target). However, for `binary` the select cases don’t apply as rigidly. It’s fine to take extra liberties with `target:` to be consistent with other command-line tools, like [changing case](https://github.com/caskroom/homebrew-cask/blob/6e4eb6ba58ca0d9e6d42a1d78856cc8a35cf5fce/Casks/diffmerge.rb#L11), [removing an extension](https://github.com/caskroom/homebrew-cask/blob/312ae841f1f1b2ec07f4d88b7dfdd7fbdf8d4f94/Casks/filebot.rb#L12), or [cleaning up the name](https://github.com/caskroom/homebrew-cask/blob/146917cbcc679648de6b0bccff4e9b43fce0e6c8/Casks/minishift.rb#L13).

0 comments on commit 334f331

Please sign in to comment.