mirror of
https://github.com/earendil-works/pi.git
synced 2026-10-28 09:44:37 +08:00
* feat: unify package artifact validation * fix: restrict local artifact output paths * fix: clarify package artifact module names * feat: support pnpm package artifact consumers * fix: preserve local release package installs Keep npm and Bun consumer installs as runnable release artifacts while retaining isolated validation for other packages. Simplify smoke fixtures and avoid redundant release work.
11 lines
518 B
JavaScript
11 lines
518 B
JavaScript
import { execFileSync } from "node:child_process";
|
|
import { existsSync } from "node:fs";
|
|
|
|
export function execNpmSync(args, options = {}) {
|
|
if (process.platform !== "win32") return execFileSync("npm", args, options);
|
|
const npmCli = process.env.npm_execpath;
|
|
if (!npmCli) throw new Error("Cannot locate npm on Windows. Run this command through its npm script.");
|
|
if (!existsSync(npmCli)) throw new Error(`Cannot locate the npm CLI: ${npmCli}`);
|
|
return execFileSync(process.execPath, [npmCli, ...args], options);
|
|
}
|