mirror of
https://github.com/ninxsoft/Mist.git
synced 2025-05-29 06:25:32 -04:00
Only verify shasum if not empty
This commit is contained in:
parent
c49b5a64ee
commit
24d0591822
1 changed files with 15 additions and 5 deletions
|
@ -97,17 +97,27 @@ class TaskManager: ObservableObject {
|
|||
retries: Int,
|
||||
delay retryDelay: Int
|
||||
) -> [MistTask] {
|
||||
[
|
||||
var tasks: [MistTask] = [
|
||||
MistTask(type: .download, description: firmwareURL.lastPathComponent, downloadSize: firmware.size) {
|
||||
try await DownloadManager.shared.download(firmwareURL, to: temporaryFirmwareURL, retries: retries, delay: retryDelay)
|
||||
},
|
||||
}
|
||||
]
|
||||
|
||||
if !firmware.shasum.isEmpty {
|
||||
tasks += [
|
||||
MistTask(type: .verify, description: firmwareURL.lastPathComponent) {
|
||||
try await Validator.validate(firmware, at: temporaryFirmwareURL)
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
tasks += [
|
||||
MistTask(type: .save, description: "Firmware to destination") {
|
||||
try await FileMover.move(temporaryFirmwareURL, to: destinationURL)
|
||||
}
|
||||
]
|
||||
|
||||
return tasks
|
||||
}
|
||||
|
||||
// swiftlint:enable function_parameter_count
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue