fix(server): validate OpenCode binary by spawning --version

This commit is contained in:
Shantur Rathore
2026-01-15 20:47:30 +00:00
parent e567d35438
commit dffa4907ec
2 changed files with 41 additions and 5 deletions

View File

@@ -5,10 +5,10 @@ import { EventBus } from "../events/bus"
import { LogLevel, WorkspaceLogEntry } from "../api-types"
import { Logger } from "../logger"
const WINDOWS_CMD_EXTENSIONS = new Set([".cmd", ".bat"])
const WINDOWS_POWERSHELL_EXTENSIONS = new Set([".ps1"])
export const WINDOWS_CMD_EXTENSIONS = new Set([".cmd", ".bat"])
export const WINDOWS_POWERSHELL_EXTENSIONS = new Set([".ps1"])
function buildSpawnSpec(binaryPath: string, args: string[]) {
export function buildSpawnSpec(binaryPath: string, args: string[]) {
if (process.platform !== "win32") {
return { command: binaryPath, args, options: {} as const }
}