refactor(scripts): share npm verification command execution (#162978)

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
This commit is contained in:
Vincent Koc 2026-10-02 03:44:57 +07:00 • committed by GitHub
parent 8e94badda3
commit 98d3fdae44
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 13 deletions

View file

@ -1080,7 +1080,7 @@ function readBundledExtensionPackageJsons(packageRoot: string): {
return { manifests, errors };
}
function npmExec(args: string[], cwd: string): string {
export function npmExec(args: string[], cwd: string): string {
const invocation = resolveNpmCommandInvocation({
npmArgs: args,
npmExecPath: process.env.npm_execpath,

View file

@ -13,9 +13,9 @@ import { runInstalledWorkspaceBootstrapSmoke } from "./lib/workspace-bootstrap-s
import {
collectInstalledPackageErrors,
normalizeInstalledBinaryVersion,
npmExec,
resolveInstalledBinaryCommandInvocation,
} from "./openclaw-npm-postpublish-verify.ts";
import { resolveNpmCommandInvocation } from "./openclaw-npm-release-check.ts";
import { buildCmdExeCommandLine, resolveWindowsCmdExePath } from "./windows-cmd-helpers.mjs";
type InstalledPackageJson = {
@ -113,17 +113,6 @@ function readPackedPackageJson(tarballPath: string): PackedPackageJson {
) as PackedPackageJson;
}
function npmExec(args: string[], cwd: string): string {
const invocation = resolveNpmCommandInvocation({
npmArgs: args,
npmExecPath: process.env.npm_execpath,
nodeExecPath: process.execPath,
platform: process.platform,
});
return runNpmVerifyCommand(invocation, cwd);
}
function main(argv = process.argv.slice(2)): void {
const args = parseOpenClawNpmPrepublishVerifyArgs(argv);
if (args.help) {