-
-
Notifications
You must be signed in to change notification settings - Fork 12.6k
/
Copy pathgoenv.rb
39 lines (34 loc) · 1.08 KB
/
goenv.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
class Goenv < Formula
desc "Go version management"
homepage "https://github.com/syndbg/goenv"
url "https://github.com/syndbg/goenv/archive/1.23.3.tar.gz"
sha256 "1559f2907ee0339328466fe93f3c9637b7674917db81754412c7f842749e3201"
license "MIT"
version_scheme 1
head "https://github.com/syndbg/goenv.git", branch: "master"
livecheck do
url :stable
regex(/^v?(\d+(?:\.\d+)+)$/i)
end
bottle do
rebuild 1
sha256 cellar: :any_skip_relocation, all: "18e8cdaeba562696634782aff8f2affff1201d91fab4334346942b11ece548a5"
end
def install
inreplace_files = [
"libexec/goenv",
"plugins/go-build/install.sh",
"test/goenv.bats",
"test/test_helper.bash",
]
inreplace_files << "test/init.bats" unless build.head?
inreplace inreplace_files, "/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
test do
assert_match "Usage: goenv <command> [<args>]", shell_output("#{bin}/goenv help")
end
end