homebrew-core/Formula/scalaenv.rb
Baptiste Fontaine 6c433faca8 scalaenv 0.1.4
Closes #45143.

Signed-off-by: FX Coudert <fxcoudert@gmail.com>
2019-10-11 12:48:49 +02:00

34 lines
1.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.1.4.tar.gz"
sha256 "b791aaf1e0be7e26f455b4d659fba272b5017bc702d5bb5b3a1dc7d039cd456c"
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 scalaenv-uninstall scala-build].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