split ci
This commit is contained in:
@@ -5,15 +5,13 @@ import node.childProcess.exec
|
||||
import kotlin.coroutines.resume
|
||||
import kotlin.coroutines.suspendCoroutine
|
||||
|
||||
internal actual suspend fun execute(
|
||||
command: Array<String>,
|
||||
directory: String?,
|
||||
): Shell.Result = suspendCoroutine { continuation ->
|
||||
val command = command.joinToString(" ") { "\"$it\"" }
|
||||
val options = ExecOptions.invoke(cwd = directory)
|
||||
actual suspend fun execute(vararg command: String, directory: String?): Result = suspendCoroutine { continuation ->
|
||||
val command = command.joinToString(" ") { """"$it"""" }
|
||||
val options = ExecOptions(cwd = directory)
|
||||
exec(command, options) { error, stdout, stderr ->
|
||||
val code = if (error == null) 0 else error.code!!.toInt()
|
||||
val value = (if (error == null) stdout else stderr) as String
|
||||
continuation.resume(Shell.Result(code, value))
|
||||
val code = error?.code?.toInt() ?: 0
|
||||
|
||||
val result = Result.from(code, { stdout as String }, { stderr as String })
|
||||
continuation.resume(result)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user