SynchronousProcess

1.0.8

Adds runTask func to Task to synchronously run a Task and return the output, errors and exitCode as a Tuple
saltzmanjoelh/SynchronousProcess

What's New

2016-08-19T07:19:36Z

Synchronously run a Process (formerly NSTask) and have it return the output, error and exit code as a tuple (output:String?, error:String?, exitCode:Int32)

Example:

let result = Process.run("/bin/bash", arguments: ["-c", "echo test && echo test2; echo test3"], silenceOutput: false)
if let error = result.error {
	print("Error: \(error)")
}else{
	print("Output: \(result.output)")
}

Description

  • Swift Tools 3.1.0
View More Packages from this Author

Dependencies

  • None
Last updated: Fri Oct 18 2024 22:08:27 GMT-0900 (Hawaii-Aleutian Daylight Time)