mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-20 18:14:29 -07:00
Shorten temp directory (#17901)
This commit is contained in:
@@ -25,19 +25,21 @@ import { Storage } from '../config/storage.js';
|
||||
import { promises as fs, existsSync } from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import type { Content } from '@google/genai';
|
||||
|
||||
import crypto from 'node:crypto';
|
||||
import os from 'node:os';
|
||||
import { GEMINI_DIR } from '../utils/paths.js';
|
||||
import { debugLogger } from '../utils/debugLogger.js';
|
||||
|
||||
const PROJECT_SLUG = 'project-slug';
|
||||
const TMP_DIR_NAME = 'tmp';
|
||||
const LOG_FILE_NAME = 'logs.json';
|
||||
const CHECKPOINT_FILE_NAME = 'checkpoint.json';
|
||||
|
||||
const projectDir = process.cwd();
|
||||
const hash = crypto.createHash('sha256').update(projectDir).digest('hex');
|
||||
const TEST_GEMINI_DIR = path.join(os.homedir(), GEMINI_DIR, TMP_DIR_NAME, hash);
|
||||
const TEST_GEMINI_DIR = path.join(
|
||||
os.homedir(),
|
||||
GEMINI_DIR,
|
||||
TMP_DIR_NAME,
|
||||
PROJECT_SLUG,
|
||||
);
|
||||
|
||||
const TEST_LOG_FILE_PATH = path.join(TEST_GEMINI_DIR, LOG_FILE_NAME);
|
||||
const TEST_CHECKPOINT_FILE_PATH = path.join(
|
||||
|
||||
@@ -141,6 +141,7 @@ export class Logger {
|
||||
return;
|
||||
}
|
||||
|
||||
await this.storage.initialize();
|
||||
this.geminiDir = this.storage.getProjectTempDir();
|
||||
this.logFilePath = path.join(this.geminiDir, LOG_FILE_NAME);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user