mirror of
https://github.com/corda/corda.git
synced 2024-12-28 16:58:55 +00:00
More code review tweaks.
This commit is contained in:
parent
2664a2905c
commit
34797c2735
@ -28,25 +28,19 @@ class R3Pty(val name: String, settings: SettingsProvider, dimension: Dimension,
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun createTtyConnector(command: Array<String>, environment: Map<String, String>, workingDir: String?): TtyConnector {
|
private fun createTtyConnector(command: Array<String>, environment: Map<String, String>, workingDir: String?): TtyConnector {
|
||||||
try {
|
val process = PtyProcess.exec(command, environment, workingDir)
|
||||||
val process = PtyProcess.exec(command, environment, workingDir)
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return PtyProcessTtyConnector(name, process, UTF_8)
|
return PtyProcessTtyConnector(name, process, UTF_8)
|
||||||
} catch (e: Exception) {
|
|
||||||
process.destroyForcibly()
|
|
||||||
process.waitFor(30, TimeUnit.SECONDS)
|
|
||||||
throw e
|
|
||||||
}
|
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
throw IllegalStateException(e.message, e)
|
process.destroyForcibly()
|
||||||
|
process.waitFor(30, TimeUnit.SECONDS)
|
||||||
|
throw e
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun run(args: Array<String>, envs: Map<String, String>, workingDir: String?) {
|
fun run(args: Array<String>, envs: Map<String, String>, workingDir: String?) {
|
||||||
if (terminal.isSessionRunning) {
|
check(!terminal.isSessionRunning, { "${terminal.sessionName} is already running" })
|
||||||
throw IllegalStateException(terminal.sessionName + " is already running")
|
|
||||||
}
|
|
||||||
|
|
||||||
val environment = HashMap<String, String>(envs)
|
val environment = HashMap<String, String>(envs)
|
||||||
if (!UIUtil.isWindows) {
|
if (!UIUtil.isWindows) {
|
||||||
|
Loading…
Reference in New Issue
Block a user