1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 16:28:12 -07:00

Added test to check if kobaltw is executable (*nix only.)

This commit is contained in:
Erik C. Thauvin 2017-04-10 21:10:34 -07:00
parent d710362af1
commit c737fc9a00

View file

@ -1,9 +1,10 @@
package com.beust.kobalt package com.beust.kobalt
import com.beust.kobalt.misc.KFiles import com.beust.kobalt.misc.*
import com.beust.kobalt.misc.kobaltLog
import org.testng.annotations.Test import org.testng.annotations.Test
import java.io.* import java.io.*
import java.nio.file.Files
import java.nio.file.Paths
import java.util.* import java.util.*
import java.util.jar.* import java.util.jar.*
@ -37,6 +38,11 @@ class VerifyKobaltZipTest : KobaltTest() {
throw KobaltException("kobaltw has wrong line endings") throw KobaltException("kobaltw has wrong line endings")
} }
} }
if (System.getProperty("os.name").contains("Windows")) {
warn("Can't determine if kobaltw is executable under Windows")
} else if (!Files.isExecutable(Paths.get("dist/kobaltw"))) {
throw KobaltException("kobaltw has invalid permissions")
}
foundKobaltw = true foundKobaltw = true
} else if (entry.name.endsWith(mainJarFilePath)) { } else if (entry.name.endsWith(mainJarFilePath)) {
val ins = zipFile.getInputStream(entry) val ins = zipFile.getInputStream(entry)