diff options
| author | Olcan <[email protected]> | 2025-06-10 00:33:42 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-10 00:33:42 -0700 |
| commit | 749c010a0dd3be3ac2979c891a3a9eeba75ec50b (patch) | |
| tree | a1d943fa34b23ba08f06e03e5b7a9515cd9dc3df /scripts/sandbox_command.js | |
| parent | c7e82965b123adb5d548d186182c3a7413c404c3 (diff) | |
strip json comments in newly created sandbox_command.js (consistent w/ bash version) (#886)
Diffstat (limited to 'scripts/sandbox_command.js')
| -rw-r--r-- | scripts/sandbox_command.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/sandbox_command.js b/scripts/sandbox_command.js index 7f8e8381..d115f97f 100644 --- a/scripts/sandbox_command.js +++ b/scripts/sandbox_command.js @@ -20,6 +20,7 @@ import { execSync } from 'child_process'; import { existsSync, readFileSync } from 'fs'; import { join, dirname } from 'path'; +import stripJsonComments from 'strip-json-comments'; import os from 'os'; import yargs from 'yargs'; import { hideBin } from 'yargs/helpers'; @@ -36,7 +37,9 @@ let geminiSandbox = process.env.GEMINI_SANDBOX; if (!geminiSandbox) { const userSettingsFile = join(os.homedir(), '.gemini', 'settings.json'); if (existsSync(userSettingsFile)) { - const settings = JSON.parse(readFileSync(userSettingsFile, 'utf-8')); + const settings = JSON.parse( + stripJsonComments(readFileSync(userSettingsFile, 'utf-8')), + ); if (settings.sandbox) { geminiSandbox = settings.sandbox; } |
