[K/N] Make xcrun failures a bit more useful

This commit is contained in:
Sergey Bogolepov
2021-10-01 19:18:30 +07:00
committed by Space
parent 6e2c35edf5
commit 48a26204a7
@@ -90,10 +90,14 @@ private object CurrentXcode : Xcode {
}
private fun xcrun(vararg args: String): String = try {
Command("/usr/bin/xcrun", *args).getOutputLines().first()
} catch(e: KonanExternalToolFailure) {
throw MissingXcodeException("An error occurred during an xcrun execution. Make sure that Xcode and its command line tools are properly installed.", e)
}
Command("/usr/bin/xcrun", *args).getOutputLines().first()
} catch (e: KonanExternalToolFailure) {
val message = """
An error occurred during an xcrun execution. Make sure that Xcode and its command line tools are properly installed.
Failed command: /usr/bin/xcrun ${args.joinToString(" ")}
""".trimIndent()
throw MissingXcodeException(message, e)
}
private fun getSdkPath(sdk: String) = xcrun("--sdk", sdk, "--show-sdk-path")
private fun getSdkPath(sdk: String) = xcrun("--sdk", sdk, "--show-sdk-path")
}