Skip to content

Commit

Permalink
(feat/fix) added ability to force marking package as a "package" styl…
Browse files Browse the repository at this point in the history
…e installation
  • Loading branch information
mredig committed Aug 12, 2023
1 parent 8ff4b18 commit 0646956
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Sources/PKGAppcastGeneratorCore/AppcastItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public struct AppcastItem: Codable {
public let length: Int
public let type: String
public let edSignature: String?
public let installationType: String?
public var installationType: String?

static public func nodeDecoding(for key: CodingKey) -> XMLDecoder.NodeDecoding { .attribute }
static public func nodeEncoding(for key: CodingKey) -> XMLEncoder.NodeEncoding { .attribute }
Expand Down Expand Up @@ -106,6 +106,10 @@ public struct AppcastItem: Codable {

public extension AppcastItem {
init(from appCast: JSONAppcastItem, enclosure: Enclosure) {
var enclosure = enclosure
if appCast.isPackage == true {
enclosure.installationType = "package"
}
self.init(
title: appCast.title,
link: appCast.link,
Expand Down
2 changes: 2 additions & 0 deletions Sources/PKGAppcastGeneratorCore/JSONAppcastItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ public struct JSONAppcastItem: Codable {
/// This value would be `1.2.4` in `<sparkle:criticalUpdate sparkle:version="1.2.4"></sparkle:criticalUpdate>`
public let criticalUpdate: String?
public let phasedRolloutInterval: Int?

public let isPackage: Bool?
}

0 comments on commit 0646956

Please sign in to comment.