From e0f4f428fc6bef4f81db379ce1e0368004079c76 Mon Sep 17 00:00:00 2001 From: Louis Jimenez Date: Wed, 11 Jun 2025 15:33:09 -0400 Subject: Restore Checkpoint Feature (#934) --- packages/cli/src/utils/cleanup.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 packages/cli/src/utils/cleanup.ts (limited to 'packages/cli/src/utils') diff --git a/packages/cli/src/utils/cleanup.ts b/packages/cli/src/utils/cleanup.ts new file mode 100644 index 00000000..1e483373 --- /dev/null +++ b/packages/cli/src/utils/cleanup.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2025 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +import { promises as fs } from 'fs'; +import { join } from 'path'; + +export async function cleanupCheckpoints() { + const geminiDir = join(process.cwd(), '.gemini'); + const checkpointsDir = join(geminiDir, 'checkpoints'); + try { + await fs.rm(checkpointsDir, { recursive: true, force: true }); + } catch { + // Ignore errors if the directory doesn't exist or fails to delete. + } +} -- cgit v1.2.3