mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-09 02:24:11 +08:00
Merge branch 'main' of https://github.com/catlog22/Claude-Code-Workflow
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { existsSync, mkdirSync, readFileSync, writeFileSync, statSync } from 'fs';
|
||||
import { existsSync, mkdirSync, readFileSync, writeFileSync, statSync, unlinkSync, readdirSync } from 'fs';
|
||||
import { join, dirname } from 'path';
|
||||
import { StoragePaths, ensureStorageDir } from '../config/storage-paths.js';
|
||||
|
||||
@@ -118,8 +118,7 @@ export class CacheManager<T> {
|
||||
invalidate(): void {
|
||||
try {
|
||||
if (existsSync(this.cacheFile)) {
|
||||
const fs = require('fs');
|
||||
fs.unlinkSync(this.cacheFile);
|
||||
unlinkSync(this.cacheFile);
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn(`Cache invalidation error for ${this.cacheFile}:`, (err as Error).message);
|
||||
@@ -180,8 +179,7 @@ export class CacheManager<T> {
|
||||
if (depth > 3) return; // Limit recursion depth
|
||||
|
||||
try {
|
||||
const fs = require('fs');
|
||||
const entries = fs.readdirSync(dirPath, { withFileTypes: true });
|
||||
const entries = readdirSync(dirPath, { withFileTypes: true });
|
||||
|
||||
for (const entry of entries) {
|
||||
const fullPath = join(dirPath, entry.name);
|
||||
|
||||
@@ -31,8 +31,8 @@ const GLOBAL_SETTINGS_PATH = join(homedir(), '.claude', 'settings.json');
|
||||
* @returns {string}
|
||||
*/
|
||||
function getProjectSettingsPath(projectPath) {
|
||||
const normalizedPath = projectPath.replace(/\//g, '\\').replace(/^\\([a-zA-Z])\\/, '$1:\\');
|
||||
return join(normalizedPath, '.claude', 'settings.json');
|
||||
// path.join automatically handles cross-platform path separators
|
||||
return join(projectPath, '.claude', 'settings.json');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1000,8 +1000,8 @@ function writeSettingsFile(filePath, settings) {
|
||||
* @returns {string}
|
||||
*/
|
||||
function getProjectSettingsPath(projectPath) {
|
||||
const normalizedPath = projectPath.replace(/\//g, '\\').replace(/^\\([a-zA-Z])\\/, '$1:\\');
|
||||
return join(normalizedPath, '.claude', 'settings.json');
|
||||
// path.join automatically handles cross-platform path separators
|
||||
return join(projectPath, '.claude', 'settings.json');
|
||||
}
|
||||
|
||||
// ========================================
|
||||
|
||||
Reference in New Issue
Block a user