Skip to content

Commit

Permalink
Fix a crash during compilation caused by a space in the path of an klib.
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipDolnik committed Jun 3, 2024
1 parent 70ea573 commit bfa0af6
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ import java.nio.file.FileSystemNotFoundException
import java.nio.file.FileSystems

fun File.writeToZip(write: (FileSystem) -> Unit) {
val uri = URI.create("jar:file:" + this.absolutePath)
val fileUri = this.toURI()

// Solves an issues with spaces in the path
val uri = URI("jar:file", fileUri.userInfo, fileUri.host, fileUri.port, fileUri.path, fileUri.query, fileUri.fragment)

val fileSystem = try {
FileSystems.getFileSystem(uri)
Expand Down

0 comments on commit bfa0af6

Please sign in to comment.