MCPcopy Index your code
hub / github.com/AutoForgeAI/autoforge / parsePythonVersion

Function parsePythonVersion

lib/cli.js:77–86  ·  view source on GitHub ↗

* Parse a Python version string like "Python 3.13.6" and return * { major, minor, patch, raw } or null on failure.

(raw)

Source from the content-addressed store, hash-verified

75 * { major, minor, patch, raw } or null on failure.
76 */
77function parsePythonVersion(raw) {
78 const m = raw.match(/Python\s+(\d+)\.(\d+)\.(\d+)/);
79 if (!m) return null;
80 return {
81 major: Number(m[1]),
82 minor: Number(m[2]),
83 patch: Number(m[3]),
84 raw: `${m[1]}.${m[2]}.${m[3]}`,
85 };
86}
87
88/**
89 * Try a single Python candidate. Returns { exe, version } or null.

Callers 1

tryPythonCandidateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected