MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / DetectVersion

Function DetectVersion

internal/tools/installer.go:179–185  ·  view source on GitHub ↗

DetectVersion returns the tool's version string by running ` --version`. Returns "unknown" when the binary is missing or every probe fails (including timeout). Prefer Detect when the installed flag is also needed.

(tool Tool)

Source from the content-addressed store, hash-verified

177// Returns "unknown" when the binary is missing or every probe fails (including
178// timeout). Prefer Detect when the installed flag is also needed.
179func DetectVersion(tool Tool) string {
180 bin := tool.LaunchCommand()
181 if bin == "" {
182 return "unknown"
183 }
184 return detectVersion(bin)
185}
186
187// detectVersion probes the binary with a sequence of version flags, returning
188// the first non-empty response. Each probe is bounded: the process is killed

Callers

nothing calls this directly

Calls 2

detectVersionFunction · 0.85
LaunchCommandMethod · 0.80

Tested by

no test coverage detected