-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
/
Copy pathcorepack.rb
39 lines (31 loc) · 1.27 KB
/
corepack.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
class Corepack < Formula
desc "Package acting as bridge between Node projects and their package managers"
homepage "https://github.com/nodejs/corepack"
url "https://registry.npmjs.org/corepack/-/corepack-0.29.4.tgz"
sha256 "ebd45f1694cb56bfc114fc05b9322ac6c60fb535e5c33af17dfb913a796668c4"
license "MIT"
livecheck do
url "https://registry.npmjs.org/corepack/latest"
regex(/["']version["']:\s*?["']([^"']+)["']/i)
end
bottle do
sha256 cellar: :any_skip_relocation, all: "3da43ee94c2a21437b6db8bde735992f48bb0b4875b42eeb8a0e1424a8f0d694"
end
depends_on "node"
conflicts_with "hadoop", because: "both install `yarn` binaries"
conflicts_with "yarn", because: "both install `yarn` and `yarnpkg` binaries"
conflicts_with "pnpm", because: "both install `pnpm` and `pnpx` binaries"
def install
system "npm", "install", *std_npm_args
bin.install_symlink Dir["#{libexec}/bin/*"]
end
test do
system bin/"corepack"
(testpath/"package.json").write('{"name": "test"}')
system bin/"yarn", "add", "jquery"
system bin/"yarn", "add", "fsevents", "--build-from-source=true" if OS.mac?
(testpath/"package.json").delete
system bin/"pnpm", "init"
assert_predicate testpath/"package.json", :exist?, "package.json must exist"
end
end