mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-11 14:40:52 -07:00
chore: Extract '.gemini' to GEMINI_DIR constant (#10540)
Co-authored-by: Richie Foreman <richie.foreman@gmail.com>
This commit is contained in:
committed by
GitHub
parent
7beaa368a9
commit
518caae62e
@@ -25,6 +25,7 @@ import os from 'node:os';
|
||||
import yargs from 'yargs';
|
||||
import { hideBin } from 'yargs/helpers';
|
||||
import dotenv from 'dotenv';
|
||||
import { GEMINI_DIR } from '@google/gemini-cli-core';
|
||||
|
||||
const argv = yargs(hideBin(process.argv)).option('q', {
|
||||
alias: 'quiet',
|
||||
@@ -35,7 +36,7 @@ const argv = yargs(hideBin(process.argv)).option('q', {
|
||||
let geminiSandbox = process.env.GEMINI_SANDBOX;
|
||||
|
||||
if (!geminiSandbox) {
|
||||
const userSettingsFile = join(os.homedir(), '.gemini', 'settings.json');
|
||||
const userSettingsFile = join(os.homedir(), GEMINI_DIR, 'settings.json');
|
||||
if (existsSync(userSettingsFile)) {
|
||||
const settings = JSON.parse(
|
||||
stripJsonComments(readFileSync(userSettingsFile, 'utf-8')),
|
||||
@@ -49,7 +50,7 @@ if (!geminiSandbox) {
|
||||
if (!geminiSandbox) {
|
||||
let currentDir = process.cwd();
|
||||
while (true) {
|
||||
const geminiEnv = join(currentDir, '.gemini', '.env');
|
||||
const geminiEnv = join(currentDir, GEMINI_DIR, '.env');
|
||||
const regularEnv = join(currentDir, '.env');
|
||||
if (existsSync(geminiEnv)) {
|
||||
dotenv.config({ path: geminiEnv, quiet: true });
|
||||
|
||||
Reference in New Issue
Block a user