Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change default install location for apps to /Applications #9178

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ Fill in the following stanzas for your Cask:
| `name` | the full and proper name defined by the vendor, and any useful alternate names (see also [Name Stanza Details](doc/CASK_LANGUAGE_REFERENCE.md#name-stanza-details))
| `homepage` | application homepage; used for the `brew cask home` command
| `license` | a symbol identifying the license for the application. Valid category licenses include `:oss`, `:closed`, and `:unknown`. It is OK to leave as `:unknown`. (see also [License Stanza Details](doc/CASK_LANGUAGE_REFERENCE.md#license-stanza-details))
| `app` | relative path to an `.app` bundle that should be linked into the `~/Applications` folder on installation (see also [App Stanza Details](doc/CASK_LANGUAGE_REFERENCE.md#app-stanza-details))
| `app` | relative path to an `.app` bundle that should be linked into the `/Applications` folder on installation (see also [App Stanza Details](doc/CASK_LANGUAGE_REFERENCE.md#app-stanza-details))

Other commonly-used stanzas are:

Expand All @@ -164,7 +164,7 @@ Additional stanzas you might need for special use-cases:
| `binary` | relative path to a binary that should be linked into the `/usr/local/bin` folder on installation
| `input_method` | relative path to a input method that should be linked into the `~/Library/Input Methods` folder on installation
| `screen_saver` | relative path to a Screen Saver that should be linked into the `~/Library/Screen Savers` folder on installation
| `suite` | relative path to a containing directory that should be linked into the `~/Applications` folder on installation
| `suite` | relative path to a containing directory that should be linked into the `/Applications` folder on installation
| `container :nested =>` | relative path to an inner container that must be extracted before moving on with the installation; this allows us to support dmg inside tar, zip inside dmg, etc.
| `caveats` | a string or Ruby block providing the user with Cask-specific information at install time (see also [Caveats Stanza Details](doc/CASK_LANGUAGE_REFERENCE.md#caveats-stanza-details))

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ $ brew cask install google-chrome
```
And there we have it. Google Chrome installed with a few quick commands: no clicking, no dragging, no dropping.
```sh
$ open ~/Applications/"Google Chrome.app"
$ open /Applications/"Google Chrome.app"
```
## Learn More

Expand Down
14 changes: 7 additions & 7 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ $ brew cask uninstall google-chrome
```

This will both uninstall the Cask and remove symlinks which were created in
`~/Applications`.
`/Applications`.

To uninstall all versions of a Cask, use `--force`:

Expand Down Expand Up @@ -182,8 +182,8 @@ You can also modify the default installation locations used when issuing `brew c
* `--caskroom=/my/path` determines where the actual applications will be located.
Default is `/opt/homebrew-cask/Caskroom`
* `--appdir=/my/path` changes the path where the symlinks to the applications (above)
will be generated. This is commonly used to create the links in the _root_ Applications directory
instead of the _home_ Applications directory by specifying `--appdir=/Applications`. Default is `~/Applications`.
will be generated. This can be used to, for example, create the links in the _home_ Applications directory
instead of the _root_ Applications directory by specifying `--appdir=~/Applications`. Default is `/Applications`.
* `--prefpanedir=/my/path` changes the path for PreferencePane symlinks.
Default is `~/Library/PreferencePanes`
* `--qlplugindir=/my/path` changes the path for Quicklook Plugin symlinks.
Expand All @@ -202,16 +202,16 @@ To make these settings persistent, you might want to add the following line to y

```bash
# Specify your defaults in this environment variable
export HOMEBREW_CASK_OPTS="--appdir=/Applications --caskroom=/etc/Caskroom"
export HOMEBREW_CASK_OPTS="--appdir=~/Applications --caskroom=/etc/Caskroom"
```

Note that you still can override the environment variable `HOMEBREW_CASK_OPTS` by _explicitly_ providing
options in the command line:

```bash
# Will force the Chrome app to be linked to ~/Applications
# even though HOMEBREW_CASK_OPTS specified /Applications
$ brew cask install --appdir="~/Applications" google-chrome
# Will force the Chrome app to be linked to /Applications
# even though HOMEBREW_CASK_OPTS specified ~/Applications
$ brew cask install --appdir="/Applications" google-chrome
```

## Advanced searching
Expand Down
12 changes: 6 additions & 6 deletions doc/CASK_LANGUAGE_REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Each Cask must declare one or more *artifacts* (i.e. something to install)

| name | multiple occurrences allowed? | value |
| ------------------ |------------------------------ | ----------- |
| `app` | yes | relative path to an `.app` that should be linked into the `~/Applications` folder on installation (see also [App Stanza Details](#app-stanza-details))
| `app` | yes | relative path to an `.app` that should be linked into the `/Applications` folder on installation (see also [App Stanza Details](#app-stanza-details))
| `pkg` | yes | relative path to a `.pkg` file containing the distribution (see also [Pkg Stanza Details](#pkg-stanza-details))
| `binary` | yes | relative path to a binary that should be linked into the `/usr/local/bin` folder on installation
| `colorpicker` | yes | relative path to a ColorPicker plugin that should be linked into the `~/Library/ColorPickers` folder on installation
Expand All @@ -97,7 +97,7 @@ Each Cask must declare one or more *artifacts* (i.e. something to install)
| `qlplugin` | yes | relative path to a QuickLook plugin that should be linked into the `~/Library/QuickLook` folder on installation
| `screen_saver` | yes | relative path to a Screen Saver that should be linked into the `~/Library/Screen Savers` folder on installation
| `service` | yes | relative path to a service that should be linked into the `~/Library/Services` folder on installation
| `suite` | yes | relative path to a containing directory that should be linked into the `~/Applications` folder on installation (see also [Suite Stanza Details](#suite-stanza-details))
| `suite` | yes | relative path to a containing directory that should be linked into the `/Applications` folder on installation (see also [Suite Stanza Details](#suite-stanza-details))
| `artifact` | yes | relative path to an arbitrary path that should be symlinked on installation. This is only for unusual cases. The `app` stanza is strongly preferred when linking `.app` bundles.
| `installer` | yes | describes an executable which must be run to complete the installation. (see [Installer Stanza Details](#installer-stanza-details))
| `stage_only` | no | `true`. Assert that the Cask contains no activatable artifacts.
Expand Down Expand Up @@ -440,7 +440,7 @@ follows the `url` value. Example: [libreoffice.rb](../Casks/libreoffice.rb).
## App Stanza Details

In the simple case of a string argument to `app`, a symlink is created in
the target `~/Applications` directory using the same basename as the source
the target `/Applications` directory using the same basename as the source
file. For example:

```ruby
Expand All @@ -450,7 +450,7 @@ app 'Alfred 2.app'
causes the creation of this symlink

```bash
~/Applications/Alfred 2.app
/Applications/Alfred 2.app
```

which points to a source file such as
Expand All @@ -461,7 +461,7 @@ which points to a source file such as

### Renaming the Target

You can rename the target link which appears in your `~/Applications`
You can rename the target link which appears in your `/Applications`
directory by adding a `:target` key to `app`. Example (from [scala-ide.rb](../Casks/scala-ide.rb):

```ruby
Expand Down Expand Up @@ -499,7 +499,7 @@ like [changing case](../Casks/diffmerge.rb) or [removing an extension](../Casks/

Some distributions provide a suite of multiple applications, or an
application with required data, to be installed together in a
subdirectory of `~/Applications`.
subdirectory of `/Applications`.

For these Casks, use the `suite` stanza to define the directory
containing the application suite. Example (from [sketchup.rb](../Casks/sketchup.rb)):
Expand Down
4 changes: 2 additions & 2 deletions doc/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ install applications directly into /usr/local.
We don't know up-front precisely what files are going to be in the
dmg/zip/tgz/etc, so it's really helpful to have a place to dump all of them
safely, then iterate through and act on the files we care about. For an `.app` file
this may be symlinking it into `~/Applications` or `/Applications`, for a `.pkg` file
this may be symlinking it into `/Applications` or `~/Applications`, for a `.pkg` file
this might be running the installer. For a Screen Saver it may be symlinking it
into the appropriate directory for it to show up in System Preferences.

The reason we implement this project on top of Homebrew was based on a belief
that their methodology for managing applications has a lot of merit. We'd
prefer to try and work things so that we can keep ourselves Homebrewy both in
implementation and idioms. Trying to manage all of `~/Applications` would move
implementation and idioms. Trying to manage all of `/Applications` would move
the project more towards a standalone system, which would mean reimplementing a
lot of the Homebrew stuff we lean on now.

Expand Down
2 changes: 1 addition & 1 deletion doc/src/brew-cask.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ in a future version.
Give additional feedback during installation.

* `--appdir=<path>`:
Target location for Application links. The default value is `~/Applications`.
Target location for Application links. The default value is `/Applications`.

* `--colorpickerdir=<path>`:
Target location for Color Picker links. The default value is `~/Library/Color Pickers`.
Expand Down
2 changes: 1 addition & 1 deletion lib/hbc/locations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def caskroom=(caskroom)
end

def appdir
@appdir ||= Pathname.new('~/Applications').expand_path
@appdir ||= Pathname.new('/Applications').expand_path
end

def appdir=(_appdir)
Expand Down