fix(server): validate OpenCode binary by spawning --version
This commit is contained in:
@@ -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 }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user