-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtala.rb
More file actions
39 lines (35 loc) · 1.32 KB
/
tala.rb
File metadata and controls
39 lines (35 loc) · 1.32 KB
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 Tala < Formula
desc "Advanced diagram layout engine for D2"
homepage "https://github.com/terrastruct/TALA"
version "0.4.3"
if OS.mac?
if RUBY_PLATFORM.include?("x86_64")
url "https://github.com/terrastruct/tala/releases/download/v#{version}/tala-v#{version}-macos-amd64.tar.gz"
sha256 "2145319195e5e6b663945d364928e8e0987f8d96bace9a34c026397dd5f82cc8"
else
url "https://github.com/terrastruct/tala/releases/download/v#{version}/tala-v#{version}-macos-arm64.tar.gz"
sha256 "e1d61bd23ad2a70b46fad232a47168fc82b5d21cfe57274e028b609b985d0226"
end
else
if RUBY_PLATFORM.include?("x86_64")
url "https://github.com/terrastruct/tala/releases/download/v#{version}/tala-v#{version}-linux-amd64.tar.gz"
sha256 "c5cdd95632be760c8546f30d860ee358698180448f82097a5990783737250a26"
else
url "https://github.com/terrastruct/tala/releases/download/v#{version}/tala-v#{version}-linux-arm64.tar.gz"
sha256 "268e000592486a418740382233eba1d3caa79401f52e344696145d82faf7894d"
end
end
depends_on "d2"
def install
system "make", "install", "PREFIX=#{prefix}"
end
test do
ENV["D2_LAYOUT"] = "tala"
system "#{bin}/d2plugin-tala", "--version"
example = testpath/"example.d2"
example.write <<~EOS
x -> y -> z
EOS
system "d2", "example.d2"
end
end