mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-29 12:11:09 +00:00
fix: use centralized getProjectHash in Storage class
Ensures consistent Windows path normalization across all path hashing. Previously Storage used its own getFilePathHash() which didn't apply Windows lowercase normalization, causing test failures on Windows CI.
This commit is contained in:
parent
32e17f8b58
commit
37c3a38bb1
1 changed files with 3 additions and 7 deletions
|
|
@ -6,8 +6,8 @@
|
|||
|
||||
import * as path from 'node:path';
|
||||
import * as os from 'node:os';
|
||||
import * as crypto from 'node:crypto';
|
||||
import * as fs from 'node:fs';
|
||||
import { getProjectHash } from '../utils/paths.js';
|
||||
|
||||
export const QWEN_DIR = '.qwen';
|
||||
export const GOOGLE_ACCOUNTS_FILENAME = 'google_accounts.json';
|
||||
|
|
@ -88,7 +88,7 @@ export class Storage {
|
|||
}
|
||||
|
||||
getProjectTempDir(): string {
|
||||
const hash = this.getFilePathHash(this.getProjectRoot());
|
||||
const hash = getProjectHash(this.getProjectRoot());
|
||||
const tempDir = Storage.getGlobalTempDir();
|
||||
return path.join(tempDir, hash);
|
||||
}
|
||||
|
|
@ -105,12 +105,8 @@ export class Storage {
|
|||
return this.targetDir;
|
||||
}
|
||||
|
||||
private getFilePathHash(filePath: string): string {
|
||||
return crypto.createHash('sha256').update(filePath).digest('hex');
|
||||
}
|
||||
|
||||
getHistoryDir(): string {
|
||||
const hash = this.getFilePathHash(this.getProjectRoot());
|
||||
const hash = getProjectHash(this.getProjectRoot());
|
||||
const historyDir = path.join(Storage.getGlobalQwenDir(), 'history');
|
||||
return path.join(historyDir, hash);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue