Skip to content

Commit

Permalink
fix: do not return empty strings as paths (#140)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
Kamil Winczek and github-actions[bot] authored May 20, 2022
1 parent 93bf2de commit f6fa676
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ export function getModulePaths<T extends Record<string, unknown>>(
} else if (ext.match(/ya?ml/) !== null || ext === '.tpl') {
const splitPath = dir.split('/')
splitPath.pop()
paths.push(splitPath.join('/'))
// Do not return root directory as module
if (dir !== '') {
paths.push(splitPath.join('/'))
}
}
return paths
}, [])
Expand Down

0 comments on commit f6fa676

Please sign in to comment.