refactor(cli): share update global command runner adapter

This commit is contained in:
Peter Steinberger
2026-02-21 20:19:39 +00:00
parent 944913fc98
commit a04cdc0390
3 changed files with 63 additions and 8 deletions

View File

@@ -47,6 +47,7 @@ import { createUpdateProgress, printResult } from "./progress.js";
import { prepareRestartScript, runRestartScript } from "./restart-helper.js";
import {
DEFAULT_PACKAGE_NAME,
createGlobalCommandRunner,
ensureGitCheckout,
normalizeTag,
parseTimeoutMsOrExit,
@@ -208,10 +209,7 @@ async function runPackageInstallUpdate(params: {
installKind: params.installKind,
timeoutMs: params.timeoutMs,
});
const runCommand = async (argv: string[], options: { timeoutMs: number }) => {
const res = await runCommandWithTimeout(argv, options);
return { stdout: res.stdout, stderr: res.stderr, code: res.code };
};
const runCommand = createGlobalCommandRunner();
const pkgRoot = await resolveGlobalPackageRoot(manager, runCommand, params.timeoutMs);
const packageName =