mirror of
https://github.com/nicoverbruggen/NVAppUpdater.git
synced 2025-08-07 09:40:08 +02:00
Rename to NVCaskFile
This commit is contained in:
@ -13,8 +13,8 @@ open class UpdateCheck
|
|||||||
let selfUpdaterName: String
|
let selfUpdaterName: String
|
||||||
let selfUpdaterPath: String
|
let selfUpdaterPath: String
|
||||||
|
|
||||||
private var releaseNotesUrlCallback: ((CaskFile) -> URL?)? = nil
|
private var releaseNotesUrlCallback: ((NVCaskFile) -> URL?)? = nil
|
||||||
private var caskFile: CaskFile!
|
private var caskFile: NVCaskFile!
|
||||||
private var newerVersion: AppVersion!
|
private var newerVersion: AppVersion!
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -40,7 +40,7 @@ open class UpdateCheck
|
|||||||
self.caskUrl = caskUrl
|
self.caskUrl = caskUrl
|
||||||
}
|
}
|
||||||
|
|
||||||
public func resolvingReleaseNotes(with callback: @escaping (CaskFile) -> URL?) -> Self {
|
public func resolvingReleaseNotes(with callback: @escaping (NVCaskFile) -> URL?) -> Self {
|
||||||
self.releaseNotesUrlCallback = callback
|
self.releaseNotesUrlCallback = callback
|
||||||
return self
|
return self
|
||||||
}
|
}
|
||||||
@ -53,7 +53,7 @@ open class UpdateCheck
|
|||||||
* for updates.
|
* for updates.
|
||||||
*/
|
*/
|
||||||
public func perform(promptOnFailure: Bool = true) async {
|
public func perform(promptOnFailure: Bool = true) async {
|
||||||
guard let caskFile = CaskFile.from(url: caskUrl) else {
|
guard let caskFile = NVCaskFile.from(url: caskUrl) else {
|
||||||
Log.text("The contents of the CaskFile at '\(caskUrl.absoluteString)' could not be retrieved.")
|
Log.text("The contents of the CaskFile at '\(caskUrl.absoluteString)' could not be retrieved.")
|
||||||
return await presentCouldNotRetrieveUpdate(promptOnFailure)
|
return await presentCouldNotRetrieveUpdate(promptOnFailure)
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
public struct CaskFile {
|
public struct NVCaskFile {
|
||||||
var properties: [String: String]
|
var properties: [String: String]
|
||||||
|
|
||||||
public var name: String { return self.properties["name"]! }
|
public var name: String { return self.properties["name"]! }
|
||||||
@ -13,7 +13,7 @@ public struct CaskFile {
|
|||||||
public var sha256: String { return self.properties["sha256"]! }
|
public var sha256: String { return self.properties["sha256"]! }
|
||||||
public var version: String { return self.properties["version"]! }
|
public var version: String { return self.properties["version"]! }
|
||||||
|
|
||||||
static func from(url: URL) -> CaskFile? {
|
static func from(url: URL) -> NVCaskFile? {
|
||||||
var string: String?
|
var string: String?
|
||||||
|
|
||||||
if url.scheme == "file" {
|
if url.scheme == "file" {
|
||||||
@ -65,6 +65,6 @@ public struct CaskFile {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return CaskFile(properties: props)
|
return NVCaskFile(properties: props)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user