Merge pull request #16385 from vitorgalvao/java-caveat

Java caveat
This commit is contained in:
Vítor Galvão 2016-01-08 14:20:33 +00:00
commit 820be31808
2 changed files with 19 additions and 0 deletions

View File

@ -219,6 +219,7 @@ The following methods may be called to generate standard warning messages:
| --------------------------------- | ----------- |
| `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
| `depends_on_java(version)` | users should make sure they have the specified version of java installed (`version` should be one of `6`, `7`, or empty for `8`)
| `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

View File

@ -77,6 +77,24 @@ class Hbc::CaveatsDSL
end
end
def depends_on_java(java_version = 'latest')
if java_version == 'latest'
puts <<-EOS.undent
#{@cask} requires Java. You can install the latest version with
brew cask install java
EOS
else
puts <<-EOS.undent
#{@cask} requires Java #{java_version}. You can install it with
brew cask install caskroom/versions/java#{java_version}
EOS
end
end
def logout
puts <<-EOS.undent
You must log out and log back in for the installation of #{@cask}