From 9e2179157f95faba40858d03c166ea2497fa1da7 Mon Sep 17 00:00:00 2001 From: Pelle Wessman Date: Mon, 12 Dec 2022 18:15:59 +0100 Subject: [PATCH] Update globby to `13.1.3` Makes workaround redundant for bug described in https://github.com/sindresorhus/globby/pull/242 --- lib/utils/path-resolve.js | 32 +++++++++----------------------- package.json | 2 +- 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/lib/utils/path-resolve.js b/lib/utils/path-resolve.js index c80b237..9ce0f83 100644 --- a/lib/utils/path-resolve.js +++ b/lib/utils/path-resolve.js @@ -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) diff --git a/package.json b/package.json index 8cd9e59..056c2aa 100644 --- a/package.json +++ b/package.json @@ -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",