MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / checkRuntimeBinary

Function checkRuntimeBinary

projects/electron/src/modules/code/platform.ts:53–71  ·  view source on GitHub ↗
(binary: string)

Source from the content-addressed store, hash-verified

51 * Uses centralized subprocess runner to respect user-configured env vars (e.g., custom PATH)
52 */
53export async function checkRuntimeBinary(binary: string): Promise<BinaryCheckResult> {
54 const platform = process.platform
55 const whichCommand = platform === "win32" ? "where" : "which"
56
57 const result = await execCommand(whichCommand, [binary], { timeout: 5000 })
58
59 if (result.success) {
60 const binaryPath = result.stdout.trim().split("\n")[0] // Take first result on Windows (where returns multiple)
61 return {
62 installed: true,
63 path: binaryPath,
64 }
65 }
66
67 return {
68 installed: false,
69 error: result.stderr || "Binary not found",
70 }
71}
72
73/**
74 * Check if the managed ripgrep binary is present and functional.

Callers 1

Calls 1

execCommandFunction · 0.90

Tested by

no test coverage detected