mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-21 17:27:54 +00:00
chore: sync gemini-cli v0.1.19
This commit is contained in:
@@ -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.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user