()
| 177 | } |
| 178 | |
| 179 | function resolveNodePath() { |
| 180 | if (process.env.OPENCODE_BROWSER_NODE) return process.env.OPENCODE_BROWSER_NODE; |
| 181 | if (process.execPath && /node(\.exe)?$/.test(process.execPath)) return process.execPath; |
| 182 | try { |
| 183 | const output = execSync("which node", { stdio: ["ignore", "pipe", "ignore"] }) |
| 184 | .toString("utf8") |
| 185 | .trim(); |
| 186 | if (output) return output; |
| 187 | } catch {} |
| 188 | return process.execPath; |
| 189 | } |
| 190 | |
| 191 | function writeHostWrapper(nodePath) { |
| 192 | ensureDir(BASE_DIR); |