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

Merge pull request #404 from ethauvin/master

Added test to check if kobaltw is executable (*nix only.)
This commit is contained in:
Cedric Beust 2017-04-10 22:32:35 -07:00 committed by GitHub
commit 2966575073

View file

@ -1,9 +1,10 @@
package com.beust.kobalt
import com.beust.kobalt.misc.KFiles
import com.beust.kobalt.misc.kobaltLog
import com.beust.kobalt.misc.*
import org.testng.annotations.Test
import java.io.*
import java.nio.file.Files
import java.nio.file.Paths
import java.util.*
import java.util.jar.*
@ -37,6 +38,11 @@ class VerifyKobaltZipTest : KobaltTest() {
throw KobaltException("kobaltw has wrong line endings")
}
}
if (OperatingSystem.current().isWindows()) {
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
} else if (entry.name.endsWith(mainJarFilePath)) {
val ins = zipFile.getInputStream(entry)