Skip to content

Commit

Permalink
Fix failing build on Windows when pattern contains a wildcard
Browse files Browse the repository at this point in the history
Closes #2002
  • Loading branch information
paul-dingemans committed May 9, 2023
1 parent d3610e1 commit c2c2f58
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,15 @@ internal fun FileSystem.fileSequence(
}
var commonRootDir = rootDir
patterns.forEach { pattern ->
val patternDir =
rootDir
.resolve(pattern)
.normalize()
commonRootDir = commonRootDir.findCommonParentDir(patternDir)
try {
val patternDir =
rootDir
.resolve(pattern)
.normalize()
commonRootDir = commonRootDir.findCommonParentDir(patternDir)
} catch (e: InvalidPathException) {
// Windows throws an exception when you pass a glob to Path#resolve.
}
}

val pathMatchers = includeGlobs.map { getPathMatcher(it) }
Expand Down

0 comments on commit c2c2f58

Please sign in to comment.