Skip to content

Commit

Permalink
fix: issue where module scanning would hang with empty projects
Browse files Browse the repository at this point in the history
  • Loading branch information
edvald committed Apr 19, 2018
1 parent 9cd85c3 commit ec47c72
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/garden.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,10 @@ export class Garden {
const modulePaths: string[] = []

for await (const item of scanDirectory(this.projectRoot, scanOpts)) {
if (!item) {
continue
}

const parsedPath = parse(item.path)

if (parsedPath.base !== MODULE_CONFIG_FILENAME) {
Expand Down
1 change: 1 addition & 0 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export async function* scanDirectory(path: string, opts?: klaw.Options): AsyncIt
})
.on("end", () => {
done = true
resolver()
})

// a nice little trick to turn the stream into an async generator
Expand Down

0 comments on commit ec47c72

Please sign in to comment.