diff options
| author | Olcan <[email protected]> | 2025-04-29 10:21:09 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-04-29 10:21:09 -0700 |
| commit | 4cb7386ec65b1c71aec4cec2600d43511f9323ef (patch) | |
| tree | 196647146e4a5958d0c02360a9d20bf64661e5e2 /packages/cli | |
| parent | 28518aee0ab8ffc0881f807c41d2236afb96ae4b (diff) | |
allow command -v to fail (#212)
Diffstat (limited to 'packages/cli')
| -rw-r--r-- | packages/cli/src/gemini.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/packages/cli/src/gemini.ts b/packages/cli/src/gemini.ts index 3ac52a8e..15bb9904 100644 --- a/packages/cli/src/gemini.ts +++ b/packages/cli/src/gemini.ts @@ -25,12 +25,11 @@ const __dirname = dirname(__filename); // node.js equivalent of scripts/sandbox_command.sh function sandbox_command(): string { const sandbox = process.env.GEMINI_CODE_SANDBOX?.toLowerCase().trim() ?? ''; - const opts: object = { stdio: 'ignore' }; if (['1', 'true'].includes(sandbox)) { // look for docker or podman, in that order - if (execSync('command -v docker').toString().trim()) { + if (execSync('command -v docker || true').toString().trim()) { return 'docker'; // Set sandbox to 'docker' if found - } else if (execSync('command -v podman').toString().trim()) { + } else if (execSync('command -v podman || true').toString().trim()) { return 'podman'; // Set sandbox to 'podman' if found } else { console.error( @@ -41,7 +40,7 @@ function sandbox_command(): string { } } else if (sandbox) { // confirm that specfied command exists - if (execSync(`command -v ${sandbox}`).toString().trim()) { + if (execSync(`command -v ${sandbox} || true`).toString().trim()) { return sandbox; } else { console.error( |
