0001 #if os(Linux) 0002 import Glibc 0003 #else 0004 import Darwin 0005 #endif 0006 0007 0008 struct InvocationError: ErrorType { 0009 init
Invoke.swift:23 throw InvocationError(command: command, arguments: arguments, code: code)(command:String, arguments:[String], code:Int32) { 0010 0011 } 0012 } 0013 0014 /// Invoke a subprocess 0015 func invoke
Invoke.swift:23 throw InvocationError(command: command, arguments: arguments, code: code)(command:String, _ arguments:[String]) throws { 0016 // TODO - Properly invoke subprocess with exec, arguments are not escaped 0017 let args = arguments.joinWithSeparator(" ") 0018 0019 fflush(stdout) 0020 let code = system("\(command) \(args)") 0021 0022 if code != 0 { 0023 throw InvocationError(command: command, arguments: arguments, code: code) 0024 } 0025 } 0026
main.swift:28 try invoke("swiftc", arguments)main.swift:32 try invoke(".build/debug/spectre-runner", [])