chore: sync gemini-cli v0.1.19

This commit is contained in:
tanzhenxin
2025-08-18 19:55:46 +08:00
244 changed files with 19407 additions and 5030 deletions

View File

@@ -8,16 +8,16 @@ import { promises as fs } from 'fs';
import { join } from 'path';
import { getProjectTempDir } from '@qwen-code/qwen-code-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.
}