fix: restore fast-path comment indentation, correct reproduce script claim

Address bot review findings:
- Indent the three 'Fast path' comment blocks to match surrounding code
- Reproduce script header no longer claims the fast path catches brew
  paths with a minimal PATH — the hardcoded fallbacks do that; the fast
  path only sees binaries already in the inherited PATH
This commit is contained in:
Mayuresh Kadu
2026-08-20 18:14:41 +01:00
parent da91e70efe
commit 3edc765ddd
2 changed files with 16 additions and 15 deletions
+12 -12
View File
@@ -455,10 +455,10 @@ export const createOpenCodeEnvRuntime = (deps) => {
return null;
}
// Fast path: 'command -v' via plain sh (no login shell, no .zshrc sourcing).
// This is much faster than the full login shell probe below and catches
// brew paths when the Electron login shell env merge already augmented PATH
// or when /bin/sh has a broader default PATH than the process.
// Fast path: 'command -v' via plain sh (no login shell, no .zshrc sourcing).
// This is much faster than the full login shell probe below and catches
// brew paths when the Electron login shell env merge already augmented PATH
// or when /bin/sh has a broader default PATH than the process.
if (process.platform !== 'win32') {
try {
const fastResult = runSpawnSync('/bin/sh', ['-c', 'command -v opencode'], {
@@ -548,10 +548,10 @@ export const createOpenCodeEnvRuntime = (deps) => {
return null;
}
// Fast path: 'command -v' via plain sh (no login shell, no .zshrc sourcing).
// This is much faster than the full login shell probe below and catches
// brew paths when the Electron login shell env merge already augmented PATH
// or when /bin/sh has a broader default PATH than the process.
// Fast path: 'command -v' via plain sh (no login shell, no .zshrc sourcing).
// This is much faster than the full login shell probe below and catches
// brew paths when the Electron login shell env merge already augmented PATH
// or when /bin/sh has a broader default PATH than the process.
if (process.platform !== 'win32') {
try {
const fastResult = runSpawnSync('/bin/sh', ['-c', 'command -v node'], {
@@ -653,10 +653,10 @@ export const createOpenCodeEnvRuntime = (deps) => {
return null;
}
// Fast path: 'command -v' via plain sh (no login shell, no .zshrc sourcing).
// This is much faster than the full login shell probe below and catches
// brew paths when the Electron login shell env merge already augmented PATH
// or when /bin/sh has a broader default PATH than the process.
// Fast path: 'command -v' via plain sh (no login shell, no .zshrc sourcing).
// This is much faster than the full login shell probe below and catches
// brew paths when the Electron login shell env merge already augmented PATH
// or when /bin/sh has a broader default PATH than the process.
if (process.platform !== 'win32') {
try {
const fastResult = runSpawnSync('/bin/sh', ['-c', 'command -v bun'], {