mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-05 01:50:27 +08:00
fix: 增加对空设置文件的处理,确保返回空对象
This commit is contained in:
@@ -39,6 +39,9 @@ function readSettingsFile(filePath: string): Record<string, unknown> {
|
||||
return {};
|
||||
}
|
||||
const content = readFileSync(filePath, 'utf8');
|
||||
if (!content.trim()) {
|
||||
return {};
|
||||
}
|
||||
return JSON.parse(content);
|
||||
} catch (error: unknown) {
|
||||
console.error(`Error reading settings file ${filePath}:`, error);
|
||||
|
||||
Reference in New Issue
Block a user