Skip to content

Commit

Permalink
fixup! Fix globrex's globstar on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
nayeemrmn committed Sep 20, 2019
1 parent 9770ef2 commit 7b83407
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/globrex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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" });
Expand Down
2 changes: 2 additions & 0 deletions testing/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
]);
Expand Down

0 comments on commit 7b83407

Please sign in to comment.