Misc refinements
This commit is contained in:
@@ -85,11 +85,13 @@ class RootSession : AutoCloseable {
|
||||
*/
|
||||
fun submit(command: String) {
|
||||
val result = execQuiet(command)
|
||||
if (result.code != 0) Timber.v("$command exited with ${result.code}")
|
||||
var msg = result.err.joinToString("\n").trim()
|
||||
if (msg.isNotEmpty()) Timber.v(msg)
|
||||
msg = result.out.joinToString("\n").trim()
|
||||
if (msg.isNotEmpty()) Timber.v(msg)
|
||||
val err = result.err.joinToString("\n") { "E $it" }.trim()
|
||||
val out = result.out.joinToString("\n").trim()
|
||||
if (result.code != 0 || err.isNotEmpty() || out.isNotEmpty()) {
|
||||
Timber.v("$command exited with ${result.code}")
|
||||
if (err.isNotEmpty()) Timber.v(err)
|
||||
if (out.isNotEmpty()) Timber.v(out)
|
||||
}
|
||||
}
|
||||
|
||||
fun execQuiet(command: String, redirect: Boolean = false): Shell.Result {
|
||||
|
||||
Reference in New Issue
Block a user