-
Notifications
You must be signed in to change notification settings - Fork 0
/
klotho.rb.tmpl
47 lines (40 loc) · 1.1 KB
/
klotho.rb.tmpl
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
40
41
42
43
44
45
46
47
require "download_strategy"
class KlothoDownloadStrategy < CurlDownloadStrategy
def initialize(url, name, version, **meta)
super
end
def parse_basename(url, search_query: true)
# automatically rename the downloaded binary to klotho since the server doesn't provide a filename
"klotho"
end
end
class
{{FORMULA_NAME}} < Formula
desc ""
homepage "https://klo.dev"
license ""
version "{{VERSION}}"
depends_on "pulumi"
def install
bin.install "klotho"
end
on_macos do
on_arm do
url "http://srv.klo.dev/update/latest/darwin/arm64?stream=pro:v{{VERSION}}", :using => KlothoDownloadStrategy
sha256 "{{MACOS_ARM_SHA256}}"
end
on_intel do
url "http://srv.klo.dev/update/latest/darwin/x86_64?stream=pro:v{{VERSION}}", :using => KlothoDownloadStrategy
sha256 "{{MACOS_INTEL_SHA256}}"
end
end
on_linux do
on_intel do
url "http://srv.klo.dev/update/latest/linux/x86_64?stream=pro:v{{VERSION}}", :using => KlothoDownloadStrategy
sha256 "{{LINUX_INTEL_SHA256}}"
end
end
test do
system "klotho", "--version"
end
end