Skip to content

Commit

Permalink
Fix crash in universal builds
Browse files Browse the repository at this point in the history
  • Loading branch information
stackotter committed Dec 19, 2021
1 parent 8719811 commit 2f84f51
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Sources/swift-bundler/Subcommands/Build.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,10 @@ extension Bundler {
command += " --arch arm64 --arch x86_64"
}
let exitStatus = Shell.getExitStatus(command, packageDir, silent: false, lineHandler: { line in
if shouldBuildUniversal && line.split(separator: ":")[0].last == "%" {
let parts = line.split(separator: ":")
if shouldBuildUniversal && !parts.isEmpty && parts[0].last == "%" {
// The output style changes completely in universal builds for whatever reason :)
if let percentage = Double(line.split(separator: ":")[0].dropLast()) {
if let percentage = Double(parts[0].dropLast()) {
updateProgress(line, 0.8 * (percentage / 100) + 0.1, shouldLog: false)
}
} else if line.starts(with: "[") {
Expand Down

0 comments on commit 2f84f51

Please sign in to comment.