From 4b28f64c43ea18630ffa91fc210a8f9475c8bee0 Mon Sep 17 00:00:00 2001 From: Fabrice Lecomte Date: Sat, 20 Mar 2021 14:33:18 +0100 Subject: [PATCH] Sort sql files on walk --- src/main/kotlin/fr/postgresjson/utils/searchSqlFiles.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/fr/postgresjson/utils/searchSqlFiles.kt b/src/main/kotlin/fr/postgresjson/utils/searchSqlFiles.kt index f4db936..36f2e68 100644 --- a/src/main/kotlin/fr/postgresjson/utils/searchSqlFiles.kt +++ b/src/main/kotlin/fr/postgresjson/utils/searchSqlFiles.kt @@ -47,5 +47,5 @@ fun URI.searchSqlFiles() = sequence { } } -private fun Path.walk(maxDepth: Int = 2147483647, vararg options: FileVisitOption) = Files.walk(this, maxDepth, *options) -private fun URI.walk(maxDepth: Int = 2147483647, vararg options: FileVisitOption) = Files.walk(Path.of(this), maxDepth, *options) +private fun Path.walk(maxDepth: Int = 2147483647, vararg options: FileVisitOption) = Files.walk(this, maxDepth, *options).sorted() +private fun URI.walk(maxDepth: Int = 2147483647, vararg options: FileVisitOption) = Files.walk(Path.of(this), maxDepth, *options).sorted()