strip json comments in newly created sandbox_command.js (consistent w/ bash version) (#886)
This commit is contained in:
parent
c7e82965b1
commit
749c010a0d
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue