()
| 19 | |
| 20 | useEffect(() => { |
| 21 | async function fetchVersion() { |
| 22 | try { |
| 23 | const res = await fetch( |
| 24 | "https://raw.githubusercontent.com/CodeGraphContext/CodeGraphContext/main/README.md" |
| 25 | ); |
| 26 | if (!res.ok) throw new Error("Failed to fetch README"); |
| 27 | |
| 28 | const text = await res.text(); |
| 29 | const match = text.match( |
| 30 | /\*\*Version:\*\*\s*([0-9]+\.[0-9]+\.[0-9]+)/i |
| 31 | ); |
| 32 | setVersion(match ? match[1] : "N/A"); |
| 33 | } catch (err) { |
| 34 | console.error(err); |
| 35 | setVersion("N/A"); |
| 36 | } |
| 37 | } |
| 38 | fetchVersion(); |
| 39 | }, []); |
| 40 |
no test coverage detected