-
Notifications
You must be signed in to change notification settings - Fork 1
/
dashlane-cli.rb
49 lines (40 loc) · 1.47 KB
/
dashlane-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
require "language/node"
class DashlaneCli < Formula
desc "Command-line interface for Dashlane"
homepage "https://dashlane.com"
url "https://github.com/Dashlane/dashlane-cli/archive/refs/tags/v6.2447.2.tar.gz"
sha256 "b19f31eea33f5db757ab36e5919db28930876c68f202828c9b2d360e6182b613"
license "Apache-2.0"
livecheck do
url :stable
strategy :github_latest
end
option "with-corepack", "Use yarn from corepack instead of installing it"
depends_on "node@22" => :build
# Needed for node-gyp packages
depends_on "python" => :build
depends_on "python-setuptools" => :build
depends_on "yarn" if !build.with?("corepack")
depends_on "corepack" if build.with?("corepack")
on_macos do
# macos 12+ only
depends_on macos: :monterey
end
def install
ENV["COMMIT_HASH"] = "c377153edeacd7a328204fd73cad8a825f228cc3"
Language::Node.setup_npm_environment
platform = OS.linux? ? "linux" : "macos"
system "yarn", "set", "version", "4.5.1"
system "yarn", "install", "--frozen-lockfile"
system "yarn", "run", "build"
system "yarn", "workspaces", "focus", "--production"
system "yarn", "dlx", "@yao-pkg/[email protected]", "./dist",
"-t", "node22-#{platform}-#{Hardware::CPU.arch}", "-o", "bin/dcli",
"--no-bytecode", "--public", "--public-packages", "tslib,thirty-two,node-hkdf-sync,vows"
bin.install "bin/dcli"
end
test do
# Test cli version
assert_equal version.to_s, shell_output("#{bin}/dcli --version").chomp
end
end