.text を使用して、出力ストリーム全体を取得できます。
def process = "ls -l".execute()
println "Found text ${process.text}"
エラーストリームを取得するための簡潔な同等物はありますか?
.text を使用して、出力ストリーム全体を取得できます。
def process = "ls -l".execute()
println "Found text ${process.text}"
エラーストリームを取得するための簡潔な同等物はありますか?
waitForProcessOutput2 つの Appendables を取るものを使用できます( docs here )
def process = "ls -l".execute()
def (output, error) = new StringWriter().with { o -> // For the output
  new StringWriter().with { e ->                     // For the error stream
    process.waitForProcessOutput( o, e )
    [ o, e ]*.toString()                             // Return them both
  }
}
// And print them out...
println "OUT: $output"
println "ERR: $error"