Skip to content

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

Notifications You must be signed in to change notification settings

saltzmanjoelh/SynchronousProcess

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#SynchronousProcess

Build Status Swift Version

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)")
}

About

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

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages