mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-22 04:30:47 +00:00
Fix generate_appcast failing if feed URL doesn't have lastPathComponent (#2862)
This commit is contained in:
1 file changed
+7
-1
@@ -45,7 +45,13 @@ func makeAppcasts(archivesSourceDir: URL, outputPathURL: URL?, cacheDirectory ca
|
||||
// Group updates by appcast feed
|
||||
var updatesByAppcast: [FeedName: [ArchiveItem]] = [:]
|
||||
for update in allUpdates {
|
||||
let appcastFile = update.feedURL?.lastPathComponent ?? "appcast.xml"
|
||||
let appcastFile: String
|
||||
if let lastComponent = update.feedURL?.lastPathComponent, !lastComponent.isEmpty {
|
||||
appcastFile = lastComponent
|
||||
} else {
|
||||
appcastFile = "appcast.xml"
|
||||
}
|
||||
|
||||
updatesByAppcast[appcastFile, default: []].append(update)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user