@@ -38675,7 +38675,7 @@ function String2(descriptor, ...args) { |
38675 | 38675 | } |
38676 | 38676 |
|
38677 | 38677 | // package.json |
38678 | | -var version = "0.18.0"; |
| 38678 | +var version = "0.18.1"; |
38679 | 38679 |
|
38680 | 38680 | // sources/Engine.ts |
38681 | 38681 | var import_fs3 = __toESM(require("fs")); |
@@ -38718,7 +38718,7 @@ var config_default = { |
38718 | 38718 | } |
38719 | 38719 | }, |
38720 | 38720 | pnpm: { |
38721 | | - default: "8.5.1+sha1.97019f5a8ec2416123506419ab36dd558e4c72eb", |
| 38721 | + default: "8.6.1+sha1.435b3c83c7de5c455ad80fd63ee7ecf3b67b949b", |
38722 | 38722 | fetchLatestFrom: { |
38723 | 38723 | type: "npm", |
38724 | 38724 | package: "pnpm" |
@@ -38770,7 +38770,7 @@ var config_default = { |
38770 | 38770 | package: "yarn" |
38771 | 38771 | }, |
38772 | 38772 | transparent: { |
38773 | | - default: "3.5.1+sha224.13b84a541cae0695210d8c99f1dbd0e89ef09d93e166a59a8f8eb7ec", |
| 38773 | + default: "3.6.0+sha224.19e47520fa56c6146388fdeb438d9dcf6630c3f277a2e1180995c3bb", |
38774 | 38774 | commands: [ |
38775 | 38775 | [ |
38776 | 38776 | "yarn", |
@@ -39088,7 +39088,7 @@ async function installVersion(installTarget, locator, { spec }) { |
39088 | 39088 | log(`Install finished`); |
39089 | 39089 | return installFolder; |
39090 | 39090 | } |
39091 | | -async function runVersion(installSpec, binName, args) { |
| 39091 | +async function runVersion(locator, installSpec, binName, args) { |
39092 | 39092 | let binPath = null; |
39093 | 39093 | if (Array.isArray(installSpec.spec.bin)) { |
39094 | 39094 | if (installSpec.spec.bin.some((bin) => bin === binName)) { |
@@ -39108,7 +39108,8 @@ async function runVersion(installSpec, binName, args) { |
39108 | 39108 | } |
39109 | 39109 | if (!binPath) |
39110 | 39110 | throw new Error(`Assertion failed: Unable to locate path for bin '${binName}'`); |
39111 | | - await Promise.resolve().then(() => __toESM(require_v8_compile_cache())); |
| 39111 | + if (locator.name !== `npm` || import_semver.default.lt(locator.reference, `9.7.0`)) |
| 39112 | + await Promise.resolve().then(() => __toESM(require_v8_compile_cache())); |
39112 | 39113 | process.env.COREPACK_ROOT = import_path3.default.dirname(require.resolve("corepack/package.json")); |
39113 | 39114 | process.argv = [ |
39114 | 39115 | process.execPath, |
@@ -39760,19 +39761,18 @@ async function executePackageManagerRequest({ packageManager, binaryName, binary |
39760 | 39761 | if (resolved === null) |
39761 | 39762 | throw new UsageError(`Failed to successfully resolve '${descriptor.range}' to a valid ${descriptor.name} release`); |
39762 | 39763 | const installSpec = await context.engine.ensurePackageManager(resolved); |
39763 | | - return await runVersion(installSpec, binaryName, args); |
| 39764 | + return await runVersion(resolved, installSpec, binaryName, args); |
39764 | 39765 | } |
39765 | | -async function main(argv) { |
| 39766 | +async function runMain(argv) { |
39766 | 39767 | const context = { |
39767 | 39768 | ...Cli.defaultContext, |
39768 | 39769 | cwd: process.cwd(), |
39769 | 39770 | engine: new Engine() |
39770 | 39771 | }; |
39771 | 39772 | const [firstArg, ...restArgs] = argv; |
39772 | 39773 | const request = getPackageManagerRequestFromCli(firstArg, context); |
39773 | | - let cli; |
39774 | 39774 | if (!request) { |
39775 | | - cli = new Cli({ |
| 39775 | + const cli = new Cli({ |
39776 | 39776 | binaryLabel: `Corepack`, |
39777 | 39777 | binaryName: `corepack`, |
39778 | 39778 | binaryVersion: version |
@@ -39783,14 +39783,14 @@ async function main(argv) { |
39783 | 39783 | cli.register(DisableCommand); |
39784 | 39784 | cli.register(HydrateCommand); |
39785 | 39785 | cli.register(PrepareCommand); |
39786 | | - return await cli.run(argv, context); |
| 39786 | + await cli.runExit(argv, context); |
39787 | 39787 | } else { |
39788 | | - const cli2 = new Cli({ |
| 39788 | + const cli = new Cli({ |
39789 | 39789 | binaryLabel: `'${request.binaryName}', via Corepack`, |
39790 | 39790 | binaryName: request.binaryName, |
39791 | 39791 | binaryVersion: `corepack/${version}` |
39792 | 39792 | }); |
39793 | | - cli2.register(class BinaryCommand extends Command { |
| 39793 | + cli.register(class BinaryCommand extends Command { |
39794 | 39794 | constructor() { |
39795 | 39795 | super(...arguments); |
39796 | 39796 | this.proxy = options_exports.Proxy(); |
@@ -39799,17 +39799,12 @@ async function main(argv) { |
39799 | 39799 | return executePackageManagerRequest(request, this.proxy, this.context); |
39800 | 39800 | } |
39801 | 39801 | }); |
39802 | | - return await cli2.run(restArgs, context); |
| 39802 | + const code = await cli.run(restArgs, context); |
| 39803 | + if (code !== 0) { |
| 39804 | + process.exitCode ??= code; |
| 39805 | + } |
39803 | 39806 | } |
39804 | 39807 | } |
39805 | | -function runMain(argv) { |
39806 | | - main(argv).then((exitCode) => { |
39807 | | - process.exitCode = exitCode; |
39808 | | - }, (err) => { |
39809 | | - console.error(err.stack); |
39810 | | - process.exitCode = 1; |
39811 | | - }); |
39812 | | -} |
39813 | 39808 | // Annotate the CommonJS export names for ESM import in node: |
39814 | 39809 | 0 && (module.exports = { |
39815 | 39810 | runMain |
|