-
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.11.3"
if OS.mac?
if Hardware::CPU.arm?
url "https://github.com/coder/coder/releases/download/v#{version}/coder_#{version}_darwin_arm64.zip"
sha256 "4a872114306ca5d29fc35c5dd858b223d6e9d98dd26dd81b1adcf0503c8cb0b1"
else
url "https://github.com/coder/coder/releases/download/v#{version}/coder_#{version}_darwin_amd64.zip"
sha256 "a8cd984ef1c67808b517857bf58a0376ca7535b1c56a1f0bd1ba695219b36726"
end
else
url "https://github.com/coder/coder/releases/download/v#{version}/coder_#{version}_linux_amd64.tar.gz"
sha256 "4da125ec9fd9a3f2be8fc106a486ae41847952e7002ef8ae4a4d3f8e088af375"
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