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