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: Wed Feb 21 2024 00:15:52 GMT-1000 (Hawaii-Aleutian Standard Time)