fix(cli): wait for background auto-update before relaunching (#20904)

This commit is contained in:
Tommaso Sciortino
2026-03-03 09:18:29 -08:00
committed by GitHub
parent f15bcaf499
commit e5207eb67f
4 changed files with 151 additions and 2 deletions

View File

@@ -5,6 +5,7 @@
*/
import { runExitCleanup } from './cleanup.js';
import { waitForUpdateCompletion } from './handleAutoUpdate.js';
/**
* Exit code used to signal that the CLI should be relaunched.
@@ -15,6 +16,7 @@ export const RELAUNCH_EXIT_CODE = 199;
* Exits the process with a special code to signal that the parent process should relaunch it.
*/
export async function relaunchApp(): Promise<void> {
await waitForUpdateCompletion();
await runExitCleanup();
process.exit(RELAUNCH_EXIT_CODE);
}