diff --git a/launcher-dist/build.gradle.kts b/launcher-dist/build.gradle.kts index b759e5e..6657d6c 100644 --- a/launcher-dist/build.gradle.kts +++ b/launcher-dist/build.gradle.kts @@ -1,4 +1,6 @@ import io.gitlab.jfronny.scripts.* +import java.nio.file.Files +import java.nio.file.Path plugins { id("inceptum.application-standalone") @@ -118,12 +120,15 @@ jlink { if (crosscompile) { tasks.jpackage { doLast { - val src = File("/root/jpackage-out") - val trg = buildDir.resolve("jpackage") - trg.mkdirs() - src.listFiles()!!.forEach { - println("Moving $it") - it.renameTo(trg.resolve(src.name)) + val src = Path.of("/root/jpackage-out") + val trg = buildDir.resolve("jpackage").toPath() + Files.createDirectories(trg) + Files.list(src).use { + it.filter { Files.isRegularFile(it) }.forEach { + val t = trg.resolve(it.fileName.toString()) + println("Moving $it to $t") + Files.move(it, t) + } } } }