Skip to content

Commit 9bc75e4

Browse files
FishbowlerSandeep Joshi
authored andcommitted
Fix system path separators for config globbing (mobile-dev-inc#2327)
fixes mobile-dev-inc#2279
1 parent 1826705 commit 9bc75e4

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

maestro-orchestra/src/main/java/maestro/orchestra/workspace/WorkspaceExecutionPlanner.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ object WorkspaceExecutionPlanner {
6363
val globs = workspaceConfig.flows ?: listOf("*")
6464

6565
val matchers = globs.flatMap { glob ->
66-
directories.map { it.fileSystem.getPathMatcher("glob:${it.pathString}/$glob") }
66+
directories.map { it.fileSystem.getPathMatcher(escapeSlashesForWindows("glob:${it.pathString}${it.fileSystem.separator}$glob")) }
6767
}
6868

6969
val unsortedFlowFiles = flowFiles + flowFilesInDirs.filter { path ->
@@ -175,6 +175,10 @@ object WorkspaceExecutionPlanner {
175175
return file.fileName.toString().substringBeforeLast(".")
176176
}
177177

178+
private fun escapeSlashesForWindows(pathString: String): String {
179+
return pathString.replace("\\","\\\\")
180+
}
181+
178182
data class FlowSequence(
179183
val flows: List<Path>,
180184
val continueOnFailure: Boolean? = true,

0 commit comments

Comments
 (0)