From 5cd33497738a0d8187af8f1503fab91f6be18638 Mon Sep 17 00:00:00 2001 From: "koalazf.99" Date: Tue, 26 Aug 2025 20:14:10 +0800 Subject: [PATCH] rename GEMINI_DIR to QWEN_DIR --- packages/cli/src/ui/commands/memoryCommand.ts | 4 ++-- packages/core/src/services/gitService.test.ts | 4 ++-- packages/core/src/services/gitService.ts | 4 ++-- packages/core/src/utils/paths.ts | 8 ++++---- packages/core/src/utils/user_account.ts | 4 ++-- packages/core/src/utils/user_id.ts | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/cli/src/ui/commands/memoryCommand.ts b/packages/cli/src/ui/commands/memoryCommand.ts index ec778f7a..7e373252 100644 --- a/packages/cli/src/ui/commands/memoryCommand.ts +++ b/packages/cli/src/ui/commands/memoryCommand.ts @@ -7,7 +7,7 @@ import { getErrorMessage, loadServerHierarchicalMemory, - GEMINI_DIR, + QWEN_DIR, } from '@qwen-code/qwen-code-core'; import path from 'node:path'; import os from 'os'; @@ -89,7 +89,7 @@ export const memoryCommand: SlashCommand = { try { const globalMemoryPath = path.join( os.homedir(), - GEMINI_DIR, + QWEN_DIR, 'QWEN.md', ); const globalMemoryContent = await fs.readFile( diff --git a/packages/core/src/services/gitService.test.ts b/packages/core/src/services/gitService.test.ts index 9820ba5f..3e1e63f7 100644 --- a/packages/core/src/services/gitService.test.ts +++ b/packages/core/src/services/gitService.test.ts @@ -10,7 +10,7 @@ import * as path from 'path'; import * as fs from 'fs/promises'; import * as os from 'os'; import type { ChildProcess } from 'node:child_process'; -import { getProjectHash, GEMINI_DIR } from '../utils/paths.js'; +import { getProjectHash, QWEN_DIR } from '../utils/paths.js'; const hoistedMockExec = vi.hoisted(() => vi.fn()); vi.mock('node:child_process', () => ({ @@ -157,7 +157,7 @@ describe('GitService', () => { let gitConfigPath: string; beforeEach(() => { - repoDir = path.join(homedir, GEMINI_DIR, 'history', hash); + repoDir = path.join(homedir, QWEN_DIR, 'history', hash); gitConfigPath = path.join(repoDir, '.gitconfig'); }); diff --git a/packages/core/src/services/gitService.ts b/packages/core/src/services/gitService.ts index 8b3fe46f..30f67cf7 100644 --- a/packages/core/src/services/gitService.ts +++ b/packages/core/src/services/gitService.ts @@ -10,7 +10,7 @@ import * as os from 'os'; import { isNodeError } from '../utils/errors.js'; import { exec } from 'node:child_process'; import { simpleGit, SimpleGit, CheckRepoActions } from 'simple-git'; -import { getProjectHash, GEMINI_DIR } from '../utils/paths.js'; +import { getProjectHash, QWEN_DIR } from '../utils/paths.js'; export class GitService { private projectRoot: string; @@ -21,7 +21,7 @@ export class GitService { private getHistoryDir(): string { const hash = getProjectHash(this.projectRoot); - return path.join(os.homedir(), GEMINI_DIR, 'history', hash); + return path.join(os.homedir(), QWEN_DIR, 'history', hash); } async initialize(): Promise { diff --git a/packages/core/src/utils/paths.ts b/packages/core/src/utils/paths.ts index 52c578cd..2b512c47 100644 --- a/packages/core/src/utils/paths.ts +++ b/packages/core/src/utils/paths.ts @@ -8,7 +8,7 @@ import path from 'node:path'; import os from 'os'; import * as crypto from 'crypto'; -export const GEMINI_DIR = '.qwen'; +export const QWEN_DIR = '.qwen'; export const GOOGLE_ACCOUNTS_FILENAME = 'google_accounts.json'; const TMP_DIR_NAME = 'tmp'; const COMMANDS_DIR_NAME = 'commands'; @@ -181,7 +181,7 @@ export function getProjectHash(projectRoot: string): string { */ export function getProjectTempDir(projectRoot: string): string { const hash = getProjectHash(projectRoot); - return path.join(os.homedir(), GEMINI_DIR, TMP_DIR_NAME, hash); + return path.join(os.homedir(), QWEN_DIR, TMP_DIR_NAME, hash); } /** @@ -189,7 +189,7 @@ export function getProjectTempDir(projectRoot: string): string { * @returns The path to the user's commands directory. */ export function getUserCommandsDir(): string { - return path.join(os.homedir(), GEMINI_DIR, COMMANDS_DIR_NAME); + return path.join(os.homedir(), QWEN_DIR, COMMANDS_DIR_NAME); } /** @@ -198,5 +198,5 @@ export function getUserCommandsDir(): string { * @returns The path to the project's commands directory. */ export function getProjectCommandsDir(projectRoot: string): string { - return path.join(projectRoot, GEMINI_DIR, COMMANDS_DIR_NAME); + return path.join(projectRoot, QWEN_DIR, COMMANDS_DIR_NAME); } diff --git a/packages/core/src/utils/user_account.ts b/packages/core/src/utils/user_account.ts index 6701dfe3..4f788fce 100644 --- a/packages/core/src/utils/user_account.ts +++ b/packages/core/src/utils/user_account.ts @@ -7,7 +7,7 @@ import path from 'node:path'; import { promises as fsp, existsSync, readFileSync } from 'node:fs'; import * as os from 'os'; -import { GEMINI_DIR, GOOGLE_ACCOUNTS_FILENAME } from './paths.js'; +import { QWEN_DIR, GOOGLE_ACCOUNTS_FILENAME } from './paths.js'; interface UserAccounts { active: string | null; @@ -15,7 +15,7 @@ interface UserAccounts { } function getGoogleAccountsCachePath(): string { - return path.join(os.homedir(), GEMINI_DIR, GOOGLE_ACCOUNTS_FILENAME); + return path.join(os.homedir(), QWEN_DIR, GOOGLE_ACCOUNTS_FILENAME); } async function readAccounts(filePath: string): Promise { diff --git a/packages/core/src/utils/user_id.ts b/packages/core/src/utils/user_id.ts index 6f16806f..50e73efe 100644 --- a/packages/core/src/utils/user_id.ts +++ b/packages/core/src/utils/user_id.ts @@ -8,10 +8,10 @@ import * as os from 'os'; import * as fs from 'fs'; import * as path from 'path'; import { randomUUID } from 'crypto'; -import { GEMINI_DIR } from './paths.js'; +import { QWEN_DIR } from './paths.js'; const homeDir = os.homedir() ?? ''; -const geminiDir = path.join(homeDir, GEMINI_DIR); +const geminiDir = path.join(homeDir, QWEN_DIR); const installationIdFile = path.join(geminiDir, 'installation_id'); function ensureGeminiDirExists() {