Skip to content

Commit

Permalink
Throw if no top repos are found (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebailey authored Aug 14, 2024
1 parent 06a65d2 commit 281dae2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/listTopRepos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@ const skipRepos = [

async function mainAsync() {
const repos = await getPopularRepos(language, repoCount, repoStartIndex, skipRepos);
if (repos.length === 0) {
throw new Error("No repos found");
}
await fs.promises.writeFile(outputPath, JSON.stringify(repos), { encoding: "utf-8" });
}

mainAsync().catch(err => {
reportError(err, "Unhandled exception");
process.exit(1);
});
});

0 comments on commit 281dae2

Please sign in to comment.