From 7a9877155373cdc4b9a056e7478a9d4d2a0dc54f Mon Sep 17 00:00:00 2001 From: "Dmitriy Y. Volkov" Date: Thu, 7 Nov 2019 23:41:19 +0300 Subject: [PATCH] waiting until task actually completes before returning from xcrun method --- Sources/XCResultKit/XCResultFile.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/XCResultKit/XCResultFile.swift b/Sources/XCResultKit/XCResultFile.swift index 9469c69..4113f42 100644 --- a/Sources/XCResultKit/XCResultFile.swift +++ b/Sources/XCResultKit/XCResultFile.swift @@ -163,7 +163,9 @@ public class XCResultFile { let data = pipe.fileHandleForReading.readDataToEndOfFile() let output: String? = String(data: data, encoding: String.Encoding.utf8) - + + task.waitUntilExit() + return output } }