fix: defer plugin sync after git switch

This commit is contained in:
Peter Steinberger
2026-04-06 00:46:38 +01:00
parent 3bc17fc823
commit be16cf2f0d
2 changed files with 49 additions and 6 deletions

View File

@@ -1061,12 +1061,26 @@ export async function updateCommand(opts: UpdateCommandOptions): Promise<void> {
}
}
await updatePluginsAfterCoreUpdate({
root,
channel,
configSnapshot: postUpdateConfigSnapshot,
opts,
});
// A package -> git switch still runs inside the pre-update CLI process.
// Plugin sync/validation can then compare new bundled plugin minima against
// the old host version and fail even though the install itself succeeded.
const deferPluginSync = switchToGit && result.mode === "git";
if (deferPluginSync) {
if (!opts.json) {
defaultRuntime.log(
theme.muted(
"Skipped plugin update sync in the pre-update CLI process after switching to a git install.",
),
);
}
} else {
await updatePluginsAfterCoreUpdate({
root,
channel,
configSnapshot: postUpdateConfigSnapshot,
opts,
});
}
await tryWriteCompletionCache(root, Boolean(opts.json));
await tryInstallShellCompletion({