Skip to content

Commit 8234ca6

Browse files
authored
Fix Java info in kscript --version (#295)
When `kotlin -java` contains Java version output like so: ``` Kotlin version 1.4.20-release-308 (JRE 15.0.1+9) ``` then `kscript --version` shows ``` Java : JRE 15.0.1+9) ``` Note the last character, a closing parenthesis that shouldn't be there. This commit fixes that issue.
1 parent 2026a28 commit 8234ca6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/kotlin/kscript/app/Kscript.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ fun main(args: Array<String>) {
7979
versionCheck()
8080
val systemInfo = evalBash("kotlin -version").stdout
8181
info("Kotlin : " + systemInfo.split('(')[0].removePrefix("Kotlin version").trim())
82-
info("Java : " + systemInfo.split('(')[1].split('-')[0].trim())
82+
info("Java : " + systemInfo.split('(')[1].split('-', ')')[0].trim())
8383
quit(0)
8484
}
8585

0 commit comments

Comments
 (0)