Skip to content

Commit 99b6423

Browse files
committed
Catch error
1 parent 6739980 commit 99b6423

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

ReleaseTooling/Sources/ZipBuilder/FrameworkBuilder.swift

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -709,13 +709,16 @@ struct FrameworkBuilder {
709709
.appendingPathComponent(frameworkBuildName(name) + ".xcframework")
710710

711711
// The arguments for the frameworks need to be separated.
712-
let frameworkArgs = frameworks.flatMap {
713-
[
714-
"-framework",
712+
let frameworkArgs = frameworks.flatMap { frameworkPath in
713+
do {
715714
// Xcode 15.0-15.2: Return the canonical path to work around issue
716715
// https://forums.swift.org/t/67439
717-
try! $0.resourceValues(forKeys: [.canonicalPathKey]).canonicalPath!,
718-
]
716+
let frameworkCanonicalPath = try frameworkPath.resourceValues(forKeys: [.canonicalPathKey])
717+
.canonicalPath!
718+
return ["-framework", frameworkCanonicalPath]
719+
} catch {
720+
fatalError("Failed to get canonical path for \(frameworkPath): \(error)")
721+
}
719722
}
720723

721724
let outputArgs = ["-output", xcframework.path]

0 commit comments

Comments
 (0)