MCPcopy Index your code
hub / github.com/anomalyco/opencode / resolveWslOpencode

Function resolveWslOpencode

packages/desktop/src/main/wsl/runtime.ts:305–315  ·  view source on GitHub ↗
(distro: string, opts?: RunWslOptions)

Source from the content-addressed store, hash-verified

303}
304
305export async function resolveWslOpencode(distro: string, opts?: RunWslOptions) {
306 return firstLine(
307 (
308 await runWslSh(
309 'if [ -x "$HOME/.opencode/bin/opencode" ]; then printf "%s\\n" "$HOME/.opencode/bin/opencode"; fi',
310 distro,
311 opts,
312 )
313 ).stdout,
314 )
315}
316
317export async function readWslCommandVersion(command: string, distro: string, opts?: RunWslOptions) {
318 const result = await runWslSh(`${shellEscape(command)} --version 2>/dev/null || true`, distro, opts)

Callers 1

spawnWslSidecarFunction · 0.90

Calls 2

firstLineFunction · 0.85
runWslShFunction · 0.85

Tested by

no test coverage detected