Last active
August 30, 2020 11:05
-
-
Save laevandus/2f5367cbc60215412f0634a7db865b41 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
removeResultBundle(at: resultBundlePath) | |
print("Running tests…") | |
let testCommand = [ | |
"xcodebuild", | |
"test-without-building", | |
"-quiet", | |
projectType, projectPath.wrappedInQuotes, | |
"-scheme", scheme.wrappedInQuotes, | |
"-destination", destinationDevice.wrappedInQuotes, | |
"-resultBundlePath", resultBundlePath.wrappedInQuotes | |
].joined(separator: " ") | |
let testStatus = Process.runZshCommand(testCommand) | |
if testStatus != 0 { | |
removeResultBundle(at: resultBundlePath) | |
exit(testStatus) | |
} | |
func removeResultBundle(at path: String) { | |
guard FileManager.default.fileExists(atPath: path) else { return } | |
try? FileManager.default.removeItem(atPath: path) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment