diff options
| author | Sandy Tao <[email protected]> | 2025-07-07 20:49:22 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-08 03:49:22 +0000 |
| commit | f7ad9a7e47426551b2f1d5a7f81e2f160b286dda (patch) | |
| tree | e20824d9ee7be537046d412b51de959273d4848a /scripts | |
| parent | a34cc6124cea4b2047c5f75b54233b3cf965f31a (diff) | |
Fix infinite loop in start.js on Windows (#3506)
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/sandbox_command.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/sandbox_command.js b/scripts/sandbox_command.js index 774018a9..a7ae3c4c 100644 --- a/scripts/sandbox_command.js +++ b/scripts/sandbox_command.js @@ -48,7 +48,7 @@ if (!geminiSandbox) { if (!geminiSandbox) { let currentDir = process.cwd(); - while (currentDir !== '/') { + while (true) { const geminiEnv = join(currentDir, '.gemini', '.env'); const regularEnv = join(currentDir, '.env'); if (existsSync(geminiEnv)) { @@ -58,7 +58,11 @@ if (!geminiSandbox) { dotenv.config({ path: regularEnv, quiet: true }); break; } - currentDir = dirname(currentDir); + const parentDir = dirname(currentDir); + if (parentDir === currentDir) { + break; + } + currentDir = parentDir; } geminiSandbox = process.env.GEMINI_SANDBOX; } |
