(repoPath, useAuth = false)
| 207 | |
| 208 | // Core: Fetch GitHub directory contents |
| 209 | const fetchGitHubContents = async (repoPath, useAuth = false) => { |
| 210 | if (useAuth && config.githubToken) { |
| 211 | console.log(`${LOG_TAG} \tDownloading with authentication`); |
| 212 | } |
| 213 | |
| 214 | const options = createGitHubOptions(repoPath); |
| 215 | const responseBody = await httpsRequest(options); |
| 216 | const contents = JSON.parse(responseBody.toString()); |
| 217 | |
| 218 | if (contents.message) { |
| 219 | throw new Error(contents.message); |
| 220 | } |
| 221 | |
| 222 | return contents; |
| 223 | }; |
| 224 | |
| 225 | // Main: Download mining pool logos |
| 226 | const downloadMiningPoolLogos = async () => { |
no test coverage detected