homebrew-core/Formula/jenv.rb

39 lines
1.0 KiB
Ruby

class Jenv < Formula
desc "Manage your Java environment"
homepage "https://www.jenv.be/"
url "https://github.com/jenv/jenv/archive/0.5.4.tar.gz"
sha256 "15a78dab7310fb487d2c2cad7f69e05d5d797dc13f2d5c9e7d0bbec4ea3f2980"
license "MIT"
head "https://github.com/jenv/jenv.git"
bottle do
sha256 cellar: :any_skip_relocation, all: "521a1ad6e28b90f1e37893d279950e35957a0580464d639ec74c398f8da6d466"
end
def install
libexec.install Dir["*"]
bin.write_exec_script libexec/"bin/jenv"
fish_function.install_symlink Dir[libexec/"fish/*.fish"]
end
def caveats
if preferred == :fish
<<~EOS
To activate jenv, run the following commands:
echo 'status --is-interactive; and source (jenv init -|psub)' >> #{shell_profile}
EOS
else
<<~EOS
To activate jenv, add the following to your #{shell_profile}:
export PATH="$HOME/.jenv/bin:$PATH"
eval "$(jenv init -)"
EOS
end
end
test do
shell_output("eval \"$(#{bin}/jenv init -)\" && jenv versions")
end
end