fun run()

in plugin-sdk-core/src/main/kotlin/com/jetbrains/teamcity/plugins/framework/common/CommandLineRunner.kt [11:34]


    fun run(commandLine: Command): RunResult? {
        val cmd = GeneralCommandLine().apply {
            exePath = commandLine.executable
            addParameters(commandLine.arguments.map { it })
        }

        val executor = CommandLineExecutor(cmd)
        return executor.runProcess(commandLine.executionTimeoutSeconds)?.let {
            val result = RunResult(
                it.exitCode,
                it.outLines.toList(),
                it.stderr.split("\\r?\\n").toList()
            )

            logger.debug(buildString {
                append("Command ${cmd.commandLineString}} finished. ")
                append("Exit code ${result.exitCode}. ")
                append("Stdout: ${result.standardOutput}. ")
                append("Stderr: ${result.errorOutput}.")
            })

            result
        }
    }