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:
@@ -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'], {
|
||||
|
||||
@@ -25,9 +25,10 @@
|
||||
* spawnSync($SHELL, ['-il', '-c', 'env -0'], { timeout: 5000 })
|
||||
*
|
||||
* If the shell startup is slow (>5s due to nvm, pyenv, etc.), this times
|
||||
* out and PATH stays minimal. The fast-path (Step 3b) catches standard brew
|
||||
* paths even with minimal PATH, and all shell probes now have a 5s timeout
|
||||
* to prevent blocking startup indefinitely.
|
||||
* out and PATH stays minimal. The hardcoded fallback paths catch standard
|
||||
* brew locations, the fast-path (Step 3b) catches binaries already visible
|
||||
* in the inherited PATH without sourcing shell config, and all shell probes
|
||||
* now have a 5s timeout to prevent blocking startup indefinitely.
|
||||
*/
|
||||
|
||||
import fs from 'node:fs';
|
||||
|
||||
Reference in New Issue
Block a user