mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-18 18:27:27 +00:00
fix(update): harden global updates
This commit is contained in:
@@ -29,6 +29,7 @@ import {
|
||||
import {
|
||||
detectGlobalInstallManagerByPresence,
|
||||
detectGlobalInstallManagerForRoot,
|
||||
cleanupGlobalRenameDirs,
|
||||
globalInstallArgs,
|
||||
resolveGlobalPackageRoot,
|
||||
type GlobalInstallManager,
|
||||
@@ -736,6 +737,12 @@ export async function updateCommand(opts: UpdateCommandOptions): Promise<void> {
|
||||
(pkgRoot ? await readPackageName(pkgRoot) : await readPackageName(root)) ??
|
||||
DEFAULT_PACKAGE_NAME;
|
||||
const beforeVersion = pkgRoot ? await readPackageVersion(pkgRoot) : null;
|
||||
if (pkgRoot) {
|
||||
await cleanupGlobalRenameDirs({
|
||||
globalRoot: path.dirname(pkgRoot),
|
||||
packageName,
|
||||
});
|
||||
}
|
||||
const updateStep = await runUpdateStep({
|
||||
name: "global update",
|
||||
argv: globalInstallArgs(manager, `${packageName}@${tag}`),
|
||||
|
||||
Reference in New Issue
Block a user