Skip to content

Commit

Permalink
Check topic existence using glob as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Emile-Filteau committed Sep 24, 2024
1 parent c21ac89 commit f997496
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function parsePost(fileName, content) {
fail(`File ${fileName} with type post must have a topic and body`);
}

if (!files.includes(topic + ".yaml")) {
if (!globSync(`${path}/${topic}.{yml,yaml}`)) {
fail(
`File ${fileName} has an invalid topic, ${topic}.yaml does not exist `
);
Expand All @@ -77,7 +77,7 @@ function parsePosts(fileName, content) {
parseAPIUser(fileName, subApi);
})

if (!files.includes(topic + ".yaml")) {
if (!globSync(`${path}/${topic}.{yml,yaml}`)) {
fail(
`File ${fileName} has an invalid topic, ${topic}.yaml does not exist `
);
Expand Down

0 comments on commit f997496

Please sign in to comment.