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

Add uninstall_depends_on_default_install_location caveat #8210

Closed
wants to merge 4 commits 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: 3 additions & 1 deletion Casks/battle-net.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@
'/Users/Shared/Battle.net'
]

caveats 'If you pick an installation directory other than /Applications when installing this cask, you will need to uninstall it manually'
caveats do
uninstall_depends_on_default_install_location
end
end
4 changes: 4 additions & 0 deletions Casks/blast2go.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@
installer :manual => 'Blast2GO Installer.app'

uninstall :delete => '/Applications/Blast2GO'

caveats do
uninstall_depends_on_default_install_location
end
end
4 changes: 3 additions & 1 deletion Casks/vuze.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@

zap :delete => '~/Library/Application Support/Vuze'

caveats 'If you pick an installation directory other than /Applications when installing this cask, you will need to uninstall it manually'
caveats do
uninstall_depends_on_default_install_location
end
end
15 changes: 8 additions & 7 deletions doc/CASK_LANGUAGE_REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,14 @@ There is a mini-DSL available within `caveats` blocks.

The following methods may be called to generate standard warning messages:

| method | description |
| --------------------------------- | ----------- |
| `path_environment_variable(path)` | users should make sure `path` is in their `$PATH` environment variable
| `zsh_path_helper(path)` | zsh users must take additional steps to make sure `path` is in their `$PATH` environment variable
| `logout` | users should log out and log back in to complete installation
| `reboot` | users should reboot to complete installation
| `files_in_usr_local` | the Cask installs files to `/usr/local`, which may confuse Homebrew
| method | description |
| -------------------------------------------------------------- | ----------- |
| `path_environment_variable(path)` | users should make sure `path` is in their `$PATH` environment variable
| `zsh_path_helper(path)` | zsh users must take additional steps to make sure `path` is in their `$PATH` environment variable
| `logout` | users should log out and log back in to complete installation
| `reboot` | users should reboot to complete installation
| `files_in_usr_local` | the Cask installs files to `/usr/local`, which may confuse Homebrew
| `uninstall_depends_on_default_install_location(optional_path)` | `uninstall` won't work if users picked an atypical location at install time

Example:

Expand Down
1 change: 1 addition & 0 deletions doc/cask_language_deltas.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ For use in *eg* interpolation:
* [`files_in_usr_local`](CASK_LANGUAGE_REFERENCE.md#caveats-mini-dsl)
* [`logout`](CASK_LANGUAGE_REFERENCE.md#caveats-mini-dsl)
* [`path_environment_variable(path)`](CASK_LANGUAGE_REFERENCE.md#caveats-mini-dsl)
* [`uninstall_depends_on_default_install_location(optional_path)`](CASK_LANGUAGE_REFERENCE.md#caveats-mini-dsl)
* [`reboot`](CASK_LANGUAGE_REFERENCE.md#caveats-mini-dsl)
* [`zsh_path_helper(path)`](CASK_LANGUAGE_REFERENCE.md#caveats-mini-dsl)

Expand Down
7 changes: 7 additions & 0 deletions lib/cask/caveats.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ def files_in_usr_local
end
end

def uninstall_depends_on_default_install_location(default_install_path = '/Applications')
puts <<-EOS.undent
If you pick an installation directory other than #{default_install_path} when installing this cask, you will need to uninstall it manually

EOS
end

def logout
puts <<-EOS.undent
You must log out and log back in for the installation of #{@cask}
Expand Down