summaryrefslogtreecommitdiff
path: root/scripts/sandbox_command.js
diff options
context:
space:
mode:
authorOlcan <[email protected]>2025-06-10 00:33:42 -0700
committerGitHub <[email protected]>2025-06-10 00:33:42 -0700
commit749c010a0dd3be3ac2979c891a3a9eeba75ec50b (patch)
treea1d943fa34b23ba08f06e03e5b7a9515cd9dc3df /scripts/sandbox_command.js
parentc7e82965b123adb5d548d186182c3a7413c404c3 (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.js5
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;
}