diff options
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. } |
