All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.leandroborgesferreira.dagcommand.utils.CommandExec.kt Maven / Gradle / Ivy

There is a newer version: 1.7.0
Show newest version
package com.github.leandroborgesferreira.dagcommand.utils

import java.util.concurrent.TimeUnit
import kotlin.streams.toList

object CommandExec : CommandExecutor {
    override fun runCommand(command: String): List =
        Runtime.getRuntime()
            .exec(command)
            .apply { waitFor(10, TimeUnit.SECONDS) }
            .inputStream
            .bufferedReader()
            .lines()
            .toList()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy