Skip to content

Commit

Permalink
fix(core): path matcher for windows were not working
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-mulier-p committed Oct 4, 2024
1 parent 98477ae commit 39c2698
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private PathMatcherPredicate(@Nullable final Path basePath, final List<String> p
} else {
pattern = mayAddRecursiveMatch(p);
}
syntaxAndPattern = SYNTAX_GLOB + pattern;
syntaxAndPattern = SYNTAX_GLOB + pattern.replace("\\", "/");
}
return syntaxAndPattern;
})
Expand All @@ -125,7 +125,7 @@ public boolean test(Path path) {
}

private static String mayAddLeadingSlash(final String path) {
return path.startsWith("/") ? path : "/" + path;
return (path.startsWith("/") || path.startsWith("\\")) ? path : "/" + path;
}

public static boolean isPrefixWithSyntax(final String pattern) {
Expand Down

0 comments on commit 39c2698

Please sign in to comment.