Skip to content
This repository has been archived by the owner on Oct 9, 2024. It is now read-only.

Commit

Permalink
Check that module paths are directories before globbing them (#38)
Browse files Browse the repository at this point in the history
Co-authored-by: Jeremy Kimber <[email protected]>
Co-authored-by: Ganesh Nalawade <[email protected]>
Co-authored-by: Sorin Sbarnea <[email protected]>
  • Loading branch information
4 people authored Sep 29, 2021
1 parent 45a2462 commit dc1680f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/utils/docsFinder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ export async function findDocumentation(
| 'builtin_doc_fragment'
| 'collection_doc_fragment'
): Promise<IModuleMetadata[]> {
if (!fs.existsSync(dir) || fs.lstatSync(dir).isFile()) {
return [];
}
let files;
switch (kind) {
case 'builtin':
Expand Down Expand Up @@ -74,6 +77,9 @@ export async function findPluginRouting(
kind: 'builtin' | 'collection'
): Promise<IPluginRoutingByCollection> {
const pluginRouting = new Map<string, IPluginRoutesByType>();
if (!fs.existsSync(dir) || fs.lstatSync(dir).isFile()) {
return pluginRouting;
}
let files;
switch (kind) {
case 'builtin':
Expand Down

0 comments on commit dc1680f

Please sign in to comment.