summaryrefslogtreecommitdiff
path: root/packages/cli/src/utils/cleanup.ts
diff options
context:
space:
mode:
authorLouis Jimenez <[email protected]>2025-06-11 15:33:09 -0400
committerGitHub <[email protected]>2025-06-11 15:33:09 -0400
commite0f4f428fc6bef4f81db379ce1e0368004079c76 (patch)
tree4f9be0dc0f8fe11de7b83c32e56bf55314de9d93 /packages/cli/src/utils/cleanup.ts
parentf75c48323ce65f651381c74ae75a1795e7cc5c45 (diff)
Restore Checkpoint Feature (#934)
Diffstat (limited to 'packages/cli/src/utils/cleanup.ts')
-rw-r--r--packages/cli/src/utils/cleanup.ts18
1 files changed, 18 insertions, 0 deletions
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.
+ }
+}