Skip to content

Commit

Permalink
Add —release-notes-url-prefix support to localized release notes
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Tharani <adamtharani@me.com>
  • Loading branch information
adamtharani authored and kornelski committed Dec 9, 2020
1 parent 65eb63f commit 02d0d74
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion generate_appcast/ArchiveItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,13 @@ class ArchiveItem: CustomStringConvertible {
.appendingPathExtension(languageCode)
.appendingPathExtension("html")
if fileManager.fileExists(atPath: localizedReleaseNoteURL.path) {
localizedReleaseNotes.append((languageCode, localizedReleaseNoteURL))
if let releaseNotesURLPrefix = self.releaseNotesURLPrefix {
localizedReleaseNotes.append((languageCode, URL(string: localizedReleaseNoteURL.lastPathComponent, relativeTo: releaseNotesURLPrefix)!))
}
else {
localizedReleaseNotes.append((languageCode, URL(string: localizedReleaseNoteURL.lastPathComponent)!))
}

}
}
return localizedReleaseNotes
Expand Down
2 changes: 1 addition & 1 deletion generate_appcast/FeedXML.swift
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func writeAppcast(appcastDestPath: URL, updates: [ArchiveItem]) throws {
for (language, url) in update.localizedReleaseNotes() {
if !languageNotesNodes.contains(where: { $0.1 == language }) {
let localizedNode = XMLNode.element(withName: SUAppcastElementReleaseNotesLink,
children: [XMLNode.text(withStringValue: url.lastPathComponent) as! XMLNode],
children: [XMLNode.text(withStringValue: url.absoluteString) as! XMLNode],
attributes: [XMLNode.attribute(withName: SUXMLLanguage,
stringValue: language) as! XMLNode, ])
item.addChild(localizedNode as! XMLNode)
Expand Down

0 comments on commit 02d0d74

Please sign in to comment.