homebrew-core/Formula/scalaenv.rb
ilovezfs fbd7c70af9
scalaenv 0.0.16
Closes #19691.

Signed-off-by: William Woodruff <william@tuffbizz.com>
2017-10-21 13:45:07 -04:00

34 lines
1 KiB
Ruby

class Scalaenv < Formula
desc "Command-line tool to manage Scala environments"
homepage "https://github.com/scalaenv/scalaenv"
url "https://github.com/scalaenv/scalaenv/archive/version/0.0.16.tar.gz"
sha256 "2324a11a4401a67430432f4ae9be11974ccb2de66bc126a1aeb7e5c74c385fa9"
head "https://github.com/scalaenv/scalaenv.git"
bottle :unneeded
def install
inreplace "libexec/scalaenv", "/usr/local", HOMEBREW_PREFIX
prefix.install "bin", "completions", "libexec"
prefix.install "plugins" => "default-plugins"
%w[scalaenv-install].each do |cmd|
bin.install_symlink "#{prefix}/default-plugins/scala-install/bin/#{cmd}"
end
end
def post_install
var_lib = HOMEBREW_PREFIX/"var/lib/scalaenv"
%w[plugins versions].each do |dir|
var_dir = "#{var_lib}/#{dir}"
mkdir_p var_dir
ln_sf var_dir, "#{prefix}/#{dir}"
end
(var_lib/"plugins").install_symlink "#{prefix}/default-plugins/scala-install"
end
test do
shell_output("eval \"$(#{bin}/scalaenv init -)\" && scalaenv versions")
end
end