mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-21 09:17:53 +00:00
[ide-mode] Close all open diffs when the CLI gets closed (#5792)
This commit is contained in:
@@ -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.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user