41 lines
1.3 KiB
Ruby
41 lines
1.3 KiB
Ruby
class Corepack < Formula
|
|
require "language/node"
|
|
|
|
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.12.1.tgz"
|
|
sha256 "0f58d22ebb0b8893f3d9c7e62fea95dd831611c8a41d628c4bdbd9fd6f14be1c"
|
|
license "MIT"
|
|
|
|
livecheck do
|
|
url "https://registry.npmjs.org/corepack/latest"
|
|
regex(/["']version["']:\s*?["']([^"']+)["']/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, all: "5bc6cd0df5ff876dfb994d1c97407beea9c21f7ac22d34ab52d8ac817dbbd566"
|
|
end
|
|
|
|
depends_on "node"
|
|
|
|
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", *Language::Node.std_npm_install_args(libexec)
|
|
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
|