Skip to content

Commit

Permalink
do not break on nested sub-directories
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasmost committed Nov 1, 2024
1 parent 38789d1 commit 11fea6c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ export async function run(): Promise<void> {
console.log("Validating against schema found at", schemaUrl);
const validate = ajv.compile(JSON.parse(schema));
for (const targetDir of targetDirs) {
const files = fs.readdirSync(targetDir);
const files = fs
.readdirSync(targetDir, { withFileTypes: true })
.filter((dirent) => dirent.isFile())
.map((dirent) => dirent.name);
for (const file of files) {
const content = fs.readFileSync(`${targetDir}/${file}`, "utf-8");
process.stdout.write(`Validating ${targetDir}/${file}...`);
Expand Down

0 comments on commit 11fea6c

Please sign in to comment.