Skip to content

Instantly share code, notes, and snippets.

Created May 24, 2017 23:53
What would you like to do?
public func shell(tool toolPath: String, arguments: [String]) -> String {
let process = Process()
process.launchPath = toolPath
process.arguments = arguments
let output = Pipe()
process.standardOutput = output
return String(
data: output.fileHandleForReading.readDataToEndOfFile(),
encoding: .utf8)!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment