Skip to content

Commit 643b1ff

Browse files
committed
use exit code rather than stderr contents to determine if command execution does not succeed
1 parent e50effc commit 643b1ff

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ plugins {
1313
}
1414

1515
group = "io.krews"
16-
version = "0.14.12"
16+
version = "0.14.13"
1717

1818
repositories {
1919
maven { setUrl("https://dl.bintray.com/kotlin/kotlin-eap") }

src/main/kotlin/krews/misc/Shell.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ class CommandExecutor(private val sshConfig: SshConfig? = null) {
2323
log.info { "Command results:\n$result" }
2424

2525
val error = process.errorStream.reader().readText()
26-
if (error.isNotBlank()) throw Exception("Encountered error during command execution: $error")
26+
val exitCode = process.waitFor()
27+
if (exitCode != 0) throw Exception("Encountered error during command execution: $error")
2728
return result
2829
}
2930

30-
}
31+
}

0 commit comments

Comments
 (0)