Skip to content

Commit

Permalink
fixed skipping directories staring with _
Browse files Browse the repository at this point in the history
  • Loading branch information
GiovanniCardamone committed Oct 19, 2020
1 parent 440f48e commit 8fd082e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,10 @@ function scan(
const combinedStat = fs.statSync(combined)

if (combinedStat.isDirectory()) {
for (const entry of fs.readdirSync(combined)) {
scan(fastify, baseDir, path.join(current, entry), log)
if (!path.basename(current).startsWith('_')) {
for (const entry of fs.readdirSync(combined)) {
scan(fastify, baseDir, path.join(current, entry), log)
}
}
} else if (isAcceptableFile(combined, combinedStat)) {
autoload(fastify, combined, pathToUrl(current), log)
Expand Down

0 comments on commit 8fd082e

Please sign in to comment.