Skip to content

Commit

Permalink
Update Xcode download URL
Browse files Browse the repository at this point in the history
The previous URL still works, but I was having issues with it when using aria2 for downloads. This new URL matches whats shown in a browser at developer.apple.com/download/more, and works with both URLSession and aria2.
  • Loading branch information
interstateone committed Oct 20, 2020
1 parent b9a253d commit 1da3d5c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/XcodesKit/XcodeList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ extension XcodeList {
.downloads
.filter { $0.name.range(of: "^Xcode [0-9]", options: .regularExpression) != nil }
.compactMap { download -> Xcode? in
let urlPrefix = "https://developer.apple.com/devcenter/download.action?path="
let urlPrefix = URL(string: "https://download.developer.apple.com/")!
guard
let xcodeFile = download.files.first(where: { $0.remotePath.hasSuffix("dmg") || $0.remotePath.hasSuffix("xip") }),
let url = URL(string: urlPrefix + xcodeFile.remotePath),
let version = Version(xcodeVersion: download.name)
else { return nil }

let url = urlPrefix.appendingPathComponent(xcodeFile.remotePath)
return Xcode(version: version, url: url, filename: String(xcodeFile.remotePath.suffix(fromLast: "/")), releaseDate: download.dateModified)
}
return xcodes
Expand Down

0 comments on commit 1da3d5c

Please sign in to comment.