fix(cli): Auto restart CLI inner node process on trust change (#8378)

This commit is contained in:
shrutip90
2025-09-17 13:05:40 -07:00
committed by GitHub
parent e76dda37ad
commit 8c0c156cbd
7 changed files with 135 additions and 49 deletions

View File

@@ -0,0 +1,20 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { runExitCleanup } from './cleanup.js';
/**
* Exit code used to signal that the CLI should be relaunched.
*/
export const RELAUNCH_EXIT_CODE = 42;
/**
* Exits the process with a special code to signal that the parent process should relaunch it.
*/
export async function relaunchApp(): Promise<void> {
await runExitCleanup();
process.exit(RELAUNCH_EXIT_CODE);
}