Fix generate_appcast failing if feed URL doesn't have lastPathComponent (#2862)

This commit is contained in:
Zorg authored and GitHub committed 2026-03-21 07:25:50 -07:00
1 parent 59ff700f51
commit cd20a12e92
1 file changed
+7 -1
+7 -1
View File
@@ -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)
}