-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcoder.rb
32 lines (28 loc) · 1.19 KB
/
coder.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
class Coder < Formula
desc "Provisions remote development environments via Terraform"
homepage "https://github.com/coder/coder"
version "2.20.2"
if OS.mac?
if Hardware::CPU.arm?
url "https://github.com/coder/coder/releases/download/v#{version}/coder_#{version}_darwin_arm64.zip"
sha256 "5bd657cd301d7321bb27a81b3fbd52d489f235fbfc62bc1294d2c2b7c85fc152"
else
url "https://github.com/coder/coder/releases/download/v#{version}/coder_#{version}_darwin_amd64.zip"
sha256 "a27d2481bdf5d4b78c39f3ed179f78ed1a2f6b9bc2add36b811e10bef2e0c069"
end
else
url "https://github.com/coder/coder/releases/download/v#{version}/coder_#{version}_linux_amd64.tar.gz"
sha256 "414210b9a9541dbd18522d8973237566639fe143bac13deb039ded973aba58a2"
end
def install
bin.install "coder"
end
test do
version_output = shell_output("#{bin}/coder version")
assert_match version.to_s, version_output
refute_match "AGPL", version_output
assert_match "Full build", version_output
assert_match "You are not logged in", shell_output("#{bin}/coder netcheck 2>&1", 1)
assert_match "postgres://", shell_output("#{bin}/coder server postgres-builtin-url")
end
end