rename GEMINI_DIR to QWEN_DIR

This commit is contained in:
koalazf.99
2025-08-26 20:14:10 +08:00
parent f73d662260
commit 5cd3349773
6 changed files with 14 additions and 14 deletions

View File

@@ -7,7 +7,7 @@
import { import {
getErrorMessage, getErrorMessage,
loadServerHierarchicalMemory, loadServerHierarchicalMemory,
GEMINI_DIR, QWEN_DIR,
} from '@qwen-code/qwen-code-core'; } from '@qwen-code/qwen-code-core';
import path from 'node:path'; import path from 'node:path';
import os from 'os'; import os from 'os';
@@ -89,7 +89,7 @@ export const memoryCommand: SlashCommand = {
try { try {
const globalMemoryPath = path.join( const globalMemoryPath = path.join(
os.homedir(), os.homedir(),
GEMINI_DIR, QWEN_DIR,
'QWEN.md', 'QWEN.md',
); );
const globalMemoryContent = await fs.readFile( const globalMemoryContent = await fs.readFile(

View File

@@ -10,7 +10,7 @@ import * as path from 'path';
import * as fs from 'fs/promises'; import * as fs from 'fs/promises';
import * as os from 'os'; import * as os from 'os';
import type { ChildProcess } from 'node:child_process'; 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()); const hoistedMockExec = vi.hoisted(() => vi.fn());
vi.mock('node:child_process', () => ({ vi.mock('node:child_process', () => ({
@@ -157,7 +157,7 @@ describe('GitService', () => {
let gitConfigPath: string; let gitConfigPath: string;
beforeEach(() => { beforeEach(() => {
repoDir = path.join(homedir, GEMINI_DIR, 'history', hash); repoDir = path.join(homedir, QWEN_DIR, 'history', hash);
gitConfigPath = path.join(repoDir, '.gitconfig'); gitConfigPath = path.join(repoDir, '.gitconfig');
}); });

View File

@@ -10,7 +10,7 @@ import * as os from 'os';
import { isNodeError } from '../utils/errors.js'; import { isNodeError } from '../utils/errors.js';
import { exec } from 'node:child_process'; import { exec } from 'node:child_process';
import { simpleGit, SimpleGit, CheckRepoActions } from 'simple-git'; 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 { export class GitService {
private projectRoot: string; private projectRoot: string;
@@ -21,7 +21,7 @@ export class GitService {
private getHistoryDir(): string { private getHistoryDir(): string {
const hash = getProjectHash(this.projectRoot); 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<void> { async initialize(): Promise<void> {

View File

@@ -8,7 +8,7 @@ import path from 'node:path';
import os from 'os'; import os from 'os';
import * as crypto from 'crypto'; import * as crypto from 'crypto';
export const GEMINI_DIR = '.qwen'; export const QWEN_DIR = '.qwen';
export const GOOGLE_ACCOUNTS_FILENAME = 'google_accounts.json'; export const GOOGLE_ACCOUNTS_FILENAME = 'google_accounts.json';
const TMP_DIR_NAME = 'tmp'; const TMP_DIR_NAME = 'tmp';
const COMMANDS_DIR_NAME = 'commands'; const COMMANDS_DIR_NAME = 'commands';
@@ -181,7 +181,7 @@ export function getProjectHash(projectRoot: string): string {
*/ */
export function getProjectTempDir(projectRoot: string): string { export function getProjectTempDir(projectRoot: string): string {
const hash = getProjectHash(projectRoot); 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. * @returns The path to the user's commands directory.
*/ */
export function getUserCommandsDir(): string { 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. * @returns The path to the project's commands directory.
*/ */
export function getProjectCommandsDir(projectRoot: string): string { export function getProjectCommandsDir(projectRoot: string): string {
return path.join(projectRoot, GEMINI_DIR, COMMANDS_DIR_NAME); return path.join(projectRoot, QWEN_DIR, COMMANDS_DIR_NAME);
} }

View File

@@ -7,7 +7,7 @@
import path from 'node:path'; import path from 'node:path';
import { promises as fsp, existsSync, readFileSync } from 'node:fs'; import { promises as fsp, existsSync, readFileSync } from 'node:fs';
import * as os from 'os'; 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 { interface UserAccounts {
active: string | null; active: string | null;
@@ -15,7 +15,7 @@ interface UserAccounts {
} }
function getGoogleAccountsCachePath(): string { 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<UserAccounts> { async function readAccounts(filePath: string): Promise<UserAccounts> {

View File

@@ -8,10 +8,10 @@ import * as os from 'os';
import * as fs from 'fs'; import * as fs from 'fs';
import * as path from 'path'; import * as path from 'path';
import { randomUUID } from 'crypto'; import { randomUUID } from 'crypto';
import { GEMINI_DIR } from './paths.js'; import { QWEN_DIR } from './paths.js';
const homeDir = os.homedir() ?? ''; 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'); const installationIdFile = path.join(geminiDir, 'installation_id');
function ensureGeminiDirExists() { function ensureGeminiDirExists() {