From 75f7dcd13eb44884bc8016927d90e8eab15dab6f Mon Sep 17 00:00:00 2001 From: Dan Fabulich Date: Mon, 2 Feb 2026 16:14:26 -0800 Subject: [PATCH] doctor: log process failures --- Sources/SkipBuild/Commands/DoctorCommand.swift | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Sources/SkipBuild/Commands/DoctorCommand.swift b/Sources/SkipBuild/Commands/DoctorCommand.swift index f19ef498..3cad3b6f 100644 --- a/Sources/SkipBuild/Commands/DoctorCommand.swift +++ b/Sources/SkipBuild/Commands/DoctorCommand.swift @@ -56,8 +56,17 @@ extension ToolOptionsCommand where Self : StreamingCommand { func checkVersion(title: String, cmd: [String], min: Version? = nil, pattern: String, watch: Bool = false, hint: String? = nil) async throws { func parseVersion(_ result: Result?) -> (result: Result?, message: MessageBlock?) { + if let result = result, case .failure(let error) = result { + self.outputOptions.logMessage("\(title): \(error)") + } guard let res = try? result?.get() else { - return (result: result, message: MessageBlock(status: .fail, title + ": error executing \(cmd.first ?? "")\(hint ?? "")")) + let errorDetail: String + if case .failure(let error) = result { + errorDetail = ": \(error)" + } else { + errorDetail = "" + } + return (result: result, message: MessageBlock(status: .fail, title + ": error executing \(cmd.first ?? "")" + errorDetail + (hint ?? ""))) } let output = res.stdout.trimmingCharacters(in: .newlines) + res.stderr.trimmingCharacters(in: .newlines)