Skip to content

Commit

Permalink
escape backslashes
Browse files Browse the repository at this point in the history
  • Loading branch information
milesziemer committed Aug 9, 2024
1 parent 3bd4554 commit 203a82c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public static String getBuildFilesWatchPattern(Project project) {
patterns.add(smithyBuildJsonPattern);
patterns.add(smithyProjectJsonPattern);
for (String buildExt : ProjectConfigLoader.SMITHY_BUILD_EXTS) {
patterns.add(root.resolve(buildExt).toString());
patterns.add(root.resolve(buildExt).toString().replace("\\", "\\\\"));
}

return "{" + String.join(",", patterns) + "}";
Expand All @@ -97,7 +97,7 @@ public static PathMatcher getBuildFilesPathMatcher(Project project) {
private static String getSmithyFilePattern(Path path, boolean isWatcherPattern) {
String glob = path.toString();
if (glob.endsWith(".smithy") || glob.endsWith(".json")) {
return glob;
return glob.replace("\\", "\\\\");
}

if (!glob.endsWith(File.separator)) {
Expand All @@ -109,6 +109,6 @@ private static String getSmithyFilePattern(Path path, boolean isWatcherPattern)
glob += ".{smithy,json}";
}

return glob;
return glob.replace("\\", "\\\\");
}
}

0 comments on commit 203a82c

Please sign in to comment.