(repo)
| 131 | } |
| 132 | |
| 133 | function getLatestVersion(repo) { |
| 134 | if (!checkCurlAvailable()) { |
| 135 | console.error('curl is required to fetch latest versions but is not installed') |
| 136 | return null |
| 137 | } |
| 138 | |
| 139 | try { |
| 140 | const url = `https://api.github.com/repos/${repo}/releases/latest` |
| 141 | const response = execSync(`curl -s "${url}"`, { encoding: 'utf-8' }) |
| 142 | const data = JSON.parse(response) |
| 143 | // Remove 'v' prefix if present |
| 144 | return data.tag_name.replace(/^v/, '') |
| 145 | } catch (error) { |
| 146 | console.error(`Failed to get latest version for ${repo}: ${error.message}`) |
| 147 | return null |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | function installDocker() { |
| 152 | const os = getPlatform() |
no test coverage detected