2016-11-12 10:35:24 +00:00
|
|
|
class Goenv < Formula
|
|
|
|
desc "Go version management"
|
|
|
|
homepage "https://github.com/syndbg/goenv"
|
2016-12-19 23:36:50 +00:00
|
|
|
url "https://github.com/syndbg/goenv/archive/v20161215.tar.gz"
|
|
|
|
sha256 "b2fb6b0dc2a359caa628e7ceee3e5c46205d41bb185d461a1c591bd119f84286"
|
2016-11-12 10:35:24 +00:00
|
|
|
head "https://github.com/syndbg/goenv.git"
|
|
|
|
|
|
|
|
bottle :unneeded
|
|
|
|
|
|
|
|
def install
|
|
|
|
inreplace "libexec/goenv", "/usr/local", HOMEBREW_PREFIX
|
|
|
|
prefix.install Dir["*"]
|
|
|
|
%w[goenv-install goenv-uninstall go-build].each do |cmd|
|
|
|
|
bin.install_symlink "#{prefix}/plugins/go-build/bin/#{cmd}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
To use Homebrew's directories rather than ~/.goenv add to your profile:
|
|
|
|
export GOENV_ROOT=#{var}/goenv
|
|
|
|
|
|
|
|
To enable shims and autocompletion add to your profile:
|
|
|
|
if which goenv > /dev/null; then eval "$(goenv init -)"; fi
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2016-11-17 23:23:52 +00:00
|
|
|
assert_match "Usage: goenv <command> [<args>]", shell_output("#{bin}/goenv help")
|
2016-11-12 10:35:24 +00:00
|
|
|
end
|
|
|
|
end
|