This commit is contained in:
@@ -9,6 +9,8 @@ import com.github.ajalt.clikt.parameters.options.default
|
||||
import com.github.ajalt.clikt.parameters.options.option
|
||||
import com.github.ajalt.clikt.parameters.types.int
|
||||
|
||||
const val SPARK = "/jars/spark.jar"
|
||||
|
||||
class ProfilerCommand: CliktCommand("profiler") {
|
||||
val pid by argument().help("Process id").int().optional()
|
||||
val port by option("--port", "-p").int().default(8543)
|
||||
@@ -16,7 +18,7 @@ class ProfilerCommand: CliktCommand("profiler") {
|
||||
override fun run() {
|
||||
if (pid != null) {
|
||||
ProcessBuilder()
|
||||
.command("java", "-jar", "/jars/spark.java", pid.toString(), "port=$port")
|
||||
.command("java", "-jar", SPARK, pid.toString(), "port=$port")
|
||||
.start()
|
||||
.waitFor()
|
||||
|
||||
@@ -27,7 +29,7 @@ class ProfilerCommand: CliktCommand("profiler") {
|
||||
.waitFor()
|
||||
} else {
|
||||
ProcessBuilder()
|
||||
.command("java", "-jar", "/jars/spark.java")
|
||||
.command("java", "-jar", SPARK)
|
||||
.inheritIO()
|
||||
.start()
|
||||
.waitFor()
|
||||
|
||||
Reference in New Issue
Block a user