Skip to content

Commit cc1bd40

Browse files
committed
Update InstallationManager.kt
1 parent 0c82d68 commit cc1bd40

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

src/main/kotlin/global/InstallationManager.kt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ object InstallationManager {
123123
try {
124124
installDir.resolve("grill").toFile().setExecutable(true)
125125
installDir.resolve("wurstscript").toFile().setExecutable(true)
126+
bundledJava.toFile().setExecutable(true)
126127
} catch (_: Exception) {
127128
}
128129
}
@@ -197,15 +198,8 @@ object InstallationManager {
197198
}
198199

199200
fun compilerLaunchCommand(vararg extraArgs: String): Array<String> {
200-
if (Files.exists(wurstscriptLauncher) && Files.exists(bundledJava)) {
201-
return if (isWindows()) {
202-
arrayOf("cmd", "/c", wurstscriptLauncher.toAbsolutePath().toString(), *extraArgs)
203-
} else {
204-
arrayOf(wurstscriptLauncher.toAbsolutePath().toString(), *extraArgs)
205-
}
206-
}
207201
val compiler = detectCompilerJar() ?: compilerJar
208-
val java = if (Files.exists(bundledJava)) bundledJava.toAbsolutePath().toString() else "java"
202+
val java = if (Files.isExecutable(bundledJava)) bundledJava.toAbsolutePath().toString() else "java"
209203
return arrayOf(java, "-jar", compiler.toAbsolutePath().toString(), *extraArgs)
210204
}
211205

0 commit comments

Comments
 (0)