-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Keep log file in root of volume for controlling installed versions (#8)
* Keep log file in root of volume for controlling installed versions. * Add several new resources
- Loading branch information
Showing
12 changed files
with
348 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
174 changes: 109 additions & 65 deletions
174
Packages/EmpusaKit/Sources/EmpusaKit/ContentManager.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import Foundation | ||
|
||
public struct DownloadedAsset { | ||
let version: String? | ||
let url: URL | ||
} |
22 changes: 22 additions & 0 deletions
22
Packages/EmpusaKit/Sources/EmpusaKit/Models/EmpusaLog.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import Foundation | ||
|
||
public struct InstalledResource: Codable { | ||
let resource: SwitchResource | ||
let version: String? | ||
var updatedAt: Date = Date() | ||
} | ||
|
||
public final class EmpusaLog: Codable { | ||
var resources: [InstalledResource] = [] | ||
|
||
func add( | ||
resource: SwitchResource, | ||
version: String? | ||
) { | ||
resources.removeAll(where: { $0.resource == resource }) | ||
resources.append(.init( | ||
resource: resource, | ||
version: version | ||
)) | ||
} | ||
} |
Oops, something went wrong.