mirror of
https://github.com/Jeuners/ECC.git
synced 2026-09-09 15:02:30 +02:00
fix(installer): reject invalid claude settings roots
This commit is contained in:
parent
9f37a5d8c7
commit
d7e6bb242a
2 changed files with 24 additions and 0 deletions
|
|
@ -49,6 +49,9 @@ function mergeHooksIntoSettings(plan) {
|
|||
if (fs.existsSync(settingsPath)) {
|
||||
try {
|
||||
settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8'));
|
||||
if (!settings || typeof settings !== 'object' || Array.isArray(settings)) {
|
||||
throw new Error('root value must be a JSON object');
|
||||
}
|
||||
} catch (error) {
|
||||
throw new Error(`Failed to parse existing settings at ${settingsPath}: ${error.message}`);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue