refactor(cli): share update global command runner adapter
This commit is contained in:
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user