diff --git a/fs/globrex.ts b/fs/globrex.ts index a520009d83a8d..b866944d9837d 100644 --- a/fs/globrex.ts +++ b/fs/globrex.ts @@ -268,9 +268,9 @@ export function globrex( let isGlobstar = starCount > 1 && // multiple "*"'s // from the start of the segment - (prevChar === SEP_RAW || prevChar === undefined) && + [SEP_RAW, "/", undefined].includes(prevChar) && // to the end of the segment - (nextChar === SEP_RAW || nextChar === undefined); + [SEP_RAW, "/", undefined].includes(nextChar); if (isGlobstar) { // it's a globstar, so match zero or more path segments add(GLOBSTAR, { only: "regex" }); diff --git a/testing/runner.ts b/testing/runner.ts index c4b04c58c9941..35781874a50a2 100755 --- a/testing/runner.ts +++ b/testing/runner.ts @@ -54,6 +54,8 @@ function partition( } function expandDirectory(dir: string, options: ExpandGlobOptions): WalkInfo[] { + console.log('expand glob', join(dir, DIR_GLOBS[0])); + console.log(glob(join(dir, DIR_GLOBS[0]), options)); return DIR_GLOBS.flatMap((s: string): WalkInfo[] => [ ...expandGlobSync(s, { ...options, root: dir }) ]);