Skip to content

Commit d9b70fa

Browse files
committedApr 29, 2024··
fix newFileSystem use non-existent URI
1 parent 56f7e71 commit d9b70fa

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎src/main/scala/sbtassembly/Assembly.scala

+5-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ object Assembly {
6767

6868
/* Closeable resources */
6969
private[sbtassembly] val jarFileSystemResource =
70-
Using.resource((uri: URI) => FileSystems.newFileSystem(uri, Map("create" -> "true").asJava))
70+
Using.resource((uri: URI) => FileSystems.newFileSystem(uri, Map.empty[String, String].asJava))
7171
private[sbtassembly] val jarEntryInputStreamResource = Using.resource((entry: JarEntry) => entry.stream())
7272
private[sbtassembly] val jarEntryOutputStreamResource = Using.resource((path: Path) =>
7373
Files.newOutputStream(path, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.CREATE)
@@ -353,6 +353,10 @@ object Assembly {
353353
throw new RuntimeException("Exiting task")
354354
} else {
355355
IO.delete(output)
356+
val dest = output.getParentFile
357+
if (!dest.exists()) {
358+
dest.mkdirs()
359+
}
356360
createJar(output, jarEntriesToWrite, jarManifest, localTime)
357361
}
358362
}

0 commit comments

Comments
 (0)
Please sign in to comment.