Created
December 11, 2019 12:14
-
-
Save drrost/c9b52372bc89f743ada52ff9425975f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env swift | |
import Foundation | |
@discardableResult | |
func shell(_ args: String...) -> Int32 { | |
let task = Process() | |
task.launchPath = "/usr/bin/env" | |
task.arguments = args | |
task.launch() | |
task.waitUntilExit() | |
return task.terminationStatus | |
} | |
shell("ls") | |
shell("xcodebuild", "-workspace", "myApp.xcworkspace") | |
// taken here https://stackoverflow.com/questions/26971240/how-do-i-run-an-terminal-command-in-a-swift-script-e-g-xcodebuild |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment