Table grid of all projects

This commit is contained in:
Julien Bisconti
2018-06-09 16:08:57 +02:00
parent c306007594
commit 10fbd6cb6f
8 changed files with 465 additions and 155 deletions

View File

@@ -85,19 +85,22 @@ async function main() {
const repos = githubRepos.map(removeHost);
const metadata = [];
/* eslint-disable no-await-in-loop */
for (let i = 0; i < repos.length; i += BATCH_SIZE) {
const batch = repos.slice(i, i + BATCH_SIZE);
if (process.env.DEBUG) console.log({ batch });
const res = await Promise.all(batch.map(async path => get(path)));
fs.appendFile(
GITHUB_METADATA_FILE,
JSON.stringify(res, null, 2),
err => err && console.error(err),
);
metadata.push(...res);
ProgressBar(i, BATCH_SIZE, repos.length);
await delay(DELAY);
}
fs.writeFile(
GITHUB_METADATA_FILE,
JSON.stringify(metadata, null, 2),
err => err && console.error(err),
);
ProgressBar(repos.length, BATCH_SIZE, repos.length);
} catch (err) {
console.error('ERROR:', err);