mirror of
https://github.com/morluto/rea
synced 2026-10-26 06:16:17 -04:00
d9660eb032
Join canonical owned command cleanup before releasing package verifier workspaces. Replace raw package command wrappers, the updater supervisor, WASM cleanup composite, and boolean-only retention with explicit capability ownership. Preserve selected environments, npm arguments, no-deadline calls, clean exit status, and distinct aggregate/per-stream output budgets. Exercise actual timeout descendants, cancellation, retained cleanup retry, and workspace admission.
20 lines
747 B
JavaScript
20 lines
747 B
JavaScript
import { dirname, join } from "node:path";
|
|
|
|
/** Preserve the caller's npm entry and arguments without invoking a shell. */
|
|
export const npmInvocation = (arguments_, environment) => {
|
|
const selectedEntry = environment.npm_execpath;
|
|
if (
|
|
selectedEntry !== undefined &&
|
|
(typeof selectedEntry !== "string" || selectedEntry.length === 0)
|
|
)
|
|
throw new Error("npm_execpath must name the selected npm CLI entry point");
|
|
const entry =
|
|
selectedEntry ??
|
|
(process.platform === "win32"
|
|
? join(dirname(process.execPath), "node_modules/npm/bin/npm-cli.js")
|
|
: undefined);
|
|
return entry === undefined
|
|
? { command: "npm", arguments: arguments_ }
|
|
: { command: process.execPath, arguments: [entry, ...arguments_] };
|
|
};
|