Skip to content

Commit

Permalink
Merge pull request #16 from banjun/print-build-error
Browse files Browse the repository at this point in the history
Print build error to log
  • Loading branch information
banjun authored Dec 29, 2023
2 parents 50d5b14 + 943e848 commit a33514b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Sources/Core/Builder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,16 @@ public final actor Builder {

NSLog("%@", "🍓 build: exec and args = ")
print("\(command.launchPath) \(command.args.joined(separator: " "))")

try command.run()

do {
try command.run()
} catch let error as NSTaskCommand.Error {
if case .failureStatus(status: _, stdout: let stdout, stderr: let stderr) = error {
if let v = stdout, !v.isEmpty { NSLog("🍓 build stdout:"); print(v) }
if let v = stderr, !v.isEmpty { NSLog("🍓 build stderr:"); print(v) }
}
throw error
}
}

/// codesign the dylib
Expand Down

0 comments on commit a33514b

Please sign in to comment.