Skip to content

Commit

Permalink
[copy-frameworks] Fix issue under no-architectures-to-remove scenario.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carthage Bot committed Feb 1, 2021
1 parent cdc5eaa commit 58551c0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Source/CarthageKit/Xcode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1385,9 +1385,14 @@ public func nonDestructivelyStripArchitectures(_ frameworkURL: URL, _ architectu
.flatMap(.race) { (relativeBinaryURL: URL, tempDir: URL) -> SignalProducer<(Data, URL), CarthageError> in
let outputURL = URL(string: relativeBinaryURL.relativePath, relativeTo: tempDir)!

let command: [String] = {
if architectures.isEmpty { return [ "-create" ] } // creating just the contents of the original
return architectures.flatMap { [ "-remove", $0 ] } // creating a binary removing the specified
}()

let arguments = [
[ relativeBinaryURL.absoluteURL.path ],
architectures.flatMap { [ "-remove", $0 ] },
command,
[ "-output", outputURL.path ],
].reduce(into: ["lipo"]) { $0.append(contentsOf: $1) }

Expand Down

0 comments on commit 58551c0

Please sign in to comment.