mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-10 14:10:37 -07:00
Introduce GEMINI_CLI_HOME for strict test isolation (#15907)
This commit is contained in:
@@ -33,10 +33,12 @@ const argv = yargs(hideBin(process.argv)).option('q', {
|
||||
default: false,
|
||||
}).argv;
|
||||
|
||||
const homedir = () => process.env['GEMINI_CLI_HOME'] || os.homedir();
|
||||
|
||||
let geminiSandbox = process.env.GEMINI_SANDBOX;
|
||||
|
||||
if (!geminiSandbox) {
|
||||
const userSettingsFile = join(os.homedir(), GEMINI_DIR, 'settings.json');
|
||||
const userSettingsFile = join(homedir(), GEMINI_DIR, 'settings.json');
|
||||
if (existsSync(userSettingsFile)) {
|
||||
const settings = JSON.parse(
|
||||
stripJsonComments(readFileSync(userSettingsFile, 'utf-8')),
|
||||
|
||||
@@ -24,8 +24,11 @@ const projectHash = crypto
|
||||
.update(projectRoot)
|
||||
.digest('hex');
|
||||
|
||||
// Returns the home directory, respecting GEMINI_CLI_HOME
|
||||
const homedir = () => process.env['GEMINI_CLI_HOME'] || os.homedir();
|
||||
|
||||
// User-level .gemini directory in home
|
||||
const USER_GEMINI_DIR = path.join(os.homedir(), GEMINI_DIR);
|
||||
const USER_GEMINI_DIR = path.join(homedir(), GEMINI_DIR);
|
||||
// Project-level .gemini directory in the workspace
|
||||
const WORKSPACE_GEMINI_DIR = path.join(projectRoot, GEMINI_DIR);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user