fix: Use Process.errorStream instead of errorReader because the latter is not supported on Android
This commit is contained in:
parent
ef075b6d13
commit
c2f0a81e8a
|
@ -89,7 +89,11 @@ private suspend fun executeCommand(array: Array<String>) {
|
||||||
Runtime.getRuntime().exec(array)
|
Runtime.getRuntime().exec(array)
|
||||||
}
|
}
|
||||||
coroutineScope {
|
coroutineScope {
|
||||||
val errorText = process.errorReader().readText()
|
val errorText = runCatching {
|
||||||
|
process.errorStream.reader().use {
|
||||||
|
it.readText()
|
||||||
|
}.trim()
|
||||||
|
}.getOrNull()
|
||||||
|
|
||||||
val exitCode = process.waitFor()
|
val exitCode = process.waitFor()
|
||||||
if (exitCode != 0) {
|
if (exitCode != 0) {
|
||||||
|
|
Loading…
Reference in New Issue