forked from pkgxdev/homebrew-made
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tea-cli.rb
50 lines (37 loc) · 1.14 KB
/
tea-cli.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
40
41
42
43
44
45
46
47
48
49
50
class TeaCli < Formula
desc "Unified package manager"
homepage "https://tea.xyz"
url "https://github.com/teaxyz/cli/releases/download/v0.22.3/tea-0.22.3.tar.xz"
sha256 "9005faebd6f8703f52ef0fb65d17e6a77b761b057ac39cd1990373543e4161d5"
license "Apache-2.0"
livecheck do
url :stable
strategy :github_latest
end
depends_on "deno" => :build
conflicts_with "tea", because: "both install `tea` binaries"
def install
system "deno", "task", "compile"
bin.install "tea"
end
def caveats
<<~EOS
You must sync pantries before most commands will work:
tea --sync -n
tea’s shell magic is its secret sauce †
If you want it add the following to your shell’s config file:
source <(tea --magic)
> † https://github.com/teaxyz/cli#magic
EOS
end
test do
(testpath/"hello.js").write <<~EOS
const middle="llo, w"
console.log(`he${middle}orld`);
EOS
with_env("TEA_PREFIX" => testpath/".tea") do
system bin/"tea --sync"
assert_equal "hello, world", shell_output("#{bin}/tea '#{testpath}/hello.js'").chomp
end
end
end