Skip to content

Commit 838ef88

Browse files
committed
Included java and kotlin version in --version (fixes #291)
1 parent 0df7102 commit 838ef88

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ fun main(args: Array<String>) {
7777
if (args.size == 1 && listOf("--help", "-h", "--version", "-v").contains(args[0])) {
7878
info(USAGE)
7979
versionCheck()
80+
val systemInfo = evalBash("kotlin -version").stdout
81+
info("Kotlin : " + systemInfo.split('(')[0].removePrefix("Kotlin version"))
82+
info("Java : " + systemInfo.split('(')[1].split('-')[0])
8083
quit(0)
8184
}
8285

@@ -279,7 +282,7 @@ fun main(args: Array<String>) {
279282

280283
var extClassPath = "${jarFile}${CP_SEPARATOR_CHAR}${KOTLIN_HOME}${File.separatorChar}lib${File.separatorChar}kotlin-script-runtime.jar"
281284
if (classpath.isNotEmpty())
282-
extClassPath += kscript.app.CP_SEPARATOR_CHAR + classpath
285+
extClassPath += CP_SEPARATOR_CHAR + classpath
283286

284287
println("kotlin ${kotlinOpts} -classpath \"${extClassPath}\" ${execClassName} ${joinedUserArgs} ")
285288
}

0 commit comments

Comments
 (0)