Skip to content

Commit eba8fed

Browse files
committed
fix: stop old cli after package-to-git switch
1 parent 4661bf6 commit eba8fed

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

src/cli/update-cli.test.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,15 +1043,7 @@ describe("update-cli", () => {
10431043
.mock.calls.map((call) => String(call[0]))
10441044
.join("\n"),
10451045
).toContain(
1046-
"Skipped plugin update sync in the pre-update CLI process after switching to a git install.",
1047-
);
1048-
expect(
1049-
vi
1050-
.mocked(defaultRuntime.log)
1051-
.mock.calls.map((call) => String(call[0]))
1052-
.join("\n"),
1053-
).toContain(
1054-
"Skipped completion/restart follow-ups in the pre-update CLI process after switching to a git install.",
1046+
"Switched from a package install to a git checkout. Skipping remaining post-update work in the old CLI process; rerun follow-up commands from the new git install if needed.",
10551047
);
10561048
});
10571049
it("explains why git updates cannot run with edited files", async () => {

src/cli/update-cli/update-command.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,6 +1038,17 @@ export async function updateCommand(opts: UpdateCommandOptions): Promise<void> {
10381038
return;
10391039
}
10401040

1041+
if (switchToGit && result.status === "ok" && result.mode === "git") {
1042+
if (!opts.json) {
1043+
defaultRuntime.log(
1044+
theme.muted(
1045+
"Switched from a package install to a git checkout. Skipping remaining post-update work in the old CLI process; rerun follow-up commands from the new git install if needed.",
1046+
),
1047+
);
1048+
}
1049+
return;
1050+
}
1051+
10411052
let postUpdateConfigSnapshot = configSnapshot;
10421053
if (requestedChannel && configSnapshot.valid && requestedChannel !== storedChannel) {
10431054
if (switchToGit) {

0 commit comments

Comments
 (0)