Skip to content

Commit

Permalink
feat: throw error if no single radar item was found
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiasschopmans committed Mar 14, 2024
1 parent 1a7ea35 commit c267082
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/buildData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,13 @@ function postProcessItems(items: Item[]): {
// Parse the data and write radar data to JSON file
parseDirectory(dataPath("radar")).then((items) => {
const data = postProcessItems(items);

if (data.items.length === 0) {
console.error("No valid radar items found.");
console.log("Please check the markdown files in the `radar` directory.");
process.exit(1);
}

const json = JSON.stringify(data, null, 2);
fs.writeFileSync(dataPath("data.json"), json);
});
Expand Down

0 comments on commit c267082

Please sign in to comment.