MCPcopy
hub / github.com/anomalyco/opencode / installWslOpencode

Function installWslOpencode

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

Source from the content-addressed store, hash-verified

260}
261
262export async function installWslOpencode(version: string, distro: string, opts?: RunWslOptions) {
263 return runInteractiveCommand(
264 resolveSystem32Command("wsl.exe"),
265 wslArgs(
266 ["bash", "-lc", `curl -fsSL https://opencode.ai/install | bash -s -- --version ${shellEscape(version)}`],
267 distro,
268 ),
269 withTimeout(opts, DEFAULT_WSL_INSTALL_TIMEOUT_MS),
270 DEFAULT_WSL_INSTALL_TIMEOUT_MS,
271 )
272}
273
274export async function probeWslDistro(name: string, opts?: RunWslOptions): Promise<WslDistroProbe> {
275 const executable = await runWslInDistro(["/bin/true"], name, opts).catch((error) => ({

Callers 1

installOpencodeFunction · 0.90

Calls 5

runInteractiveCommandFunction · 0.85
resolveSystem32CommandFunction · 0.85
wslArgsFunction · 0.85
shellEscapeFunction · 0.85
withTimeoutFunction · 0.70

Tested by

no test coverage detected