Skip to content

Commit

Permalink
Update globby to 13.1.3
Browse files Browse the repository at this point in the history
Makes workaround redundant for bug described in sindresorhus/globby#242
  • Loading branch information
Pelle Wessman committed Dec 12, 2022
1 parent c9b03ea commit 9e21791
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 24 deletions.
32 changes: 9 additions & 23 deletions lib/utils/path-resolve.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,31 +39,17 @@ const GLOB_IGNORE = [
* @throws {InputError}
*/
export async function getPackageFiles (cwd, inputPaths, config, debugLog) {
let hasPlainDot = false

// TODO [globby@>13.1.2]: The bug that requires this workaround has probably been fixed now: https://github.com/sindresorhus/globby/pull/242
const filteredInputPaths = inputPaths.filter(item => {
if (item === '.') {
hasPlainDot = true
return false
}
return true
const entries = await globby(inputPaths, {
absolute: true,
cwd,
expandDirectories: false,
gitignore: true,
ignore: [...GLOB_IGNORE],
markDirectories: true,
onlyFiles: false,
unique: true,
})

const entries = [
...(hasPlainDot ? [cwd + '/'] : []),
...(await globby(filteredInputPaths, {
absolute: true,
cwd,
expandDirectories: false,
gitignore: true,
ignore: [...GLOB_IGNORE],
markDirectories: true,
onlyFiles: false,
unique: true,
}))
]

debugLog(`Globbed resolved ${inputPaths.length} paths to ${entries.length} paths:`, entries)

const packageFiles = await mapGlobResultToFiles(entries)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"@socketsecurity/sdk": "^0.4.0",
"ajv": "^8.11.2",
"chalk": "^5.1.2",
"globby": "^13.1.2",
"globby": "^13.1.3",
"hpagent": "^1.2.0",
"ignore": "^5.2.1",
"ignore-by-default": "^2.1.0",
Expand Down

0 comments on commit 9e21791

Please sign in to comment.