diff options
| author | christine betts <[email protected]> | 2025-08-08 15:38:30 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-08-08 15:38:30 +0000 |
| commit | 3af4913ef3f00de71744de551a568aa713a3beec (patch) | |
| tree | ca71aae771662435a4c01400a701b48a4c5dbcf3 /packages/cli/src/utils/cleanup.ts | |
| parent | 5ec4ea9b4d425269c9e9052503ad85b5caaa976e (diff) | |
[ide-mode] Close all open diffs when the CLI gets closed (#5792)
Diffstat (limited to 'packages/cli/src/utils/cleanup.ts')
| -rw-r--r-- | packages/cli/src/utils/cleanup.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/cli/src/utils/cleanup.ts b/packages/cli/src/utils/cleanup.ts index 628b881c..1200b6da 100644 --- a/packages/cli/src/utils/cleanup.ts +++ b/packages/cli/src/utils/cleanup.ts @@ -8,16 +8,16 @@ import { promises as fs } from 'fs'; import { join } from 'path'; import { getProjectTempDir } from '@google/gemini-cli-core'; -const cleanupFunctions: Array<() => void> = []; +const cleanupFunctions: Array<(() => void) | (() => Promise<void>)> = []; -export function registerCleanup(fn: () => void) { +export function registerCleanup(fn: (() => void) | (() => Promise<void>)) { cleanupFunctions.push(fn); } -export function runExitCleanup() { +export async function runExitCleanup() { for (const fn of cleanupFunctions) { try { - fn(); + await fn(); } catch (_) { // Ignore errors during cleanup. } |
