mirror of
https://github.com/mas-cli/mas
synced 2024-11-21 19:23:01 +00:00
🧹 Lint
This commit is contained in:
parent
3dc5789cdf
commit
9305160b2e
2 changed files with 12 additions and 4 deletions
|
@ -31,8 +31,11 @@ extension SoftwareProduct {
|
||||||
// Only look at min OS version if we have one, also only consider macOS apps
|
// Only look at min OS version if we have one, also only consider macOS apps
|
||||||
// Replace string literal with MasStoreSearch.Entity once `search` branch is merged.
|
// Replace string literal with MasStoreSearch.Entity once `search` branch is merged.
|
||||||
if let osVersion = Version(tolerant: storeApp.minimumOsVersion), storeApp.kind == "mac-software" {
|
if let osVersion = Version(tolerant: storeApp.minimumOsVersion), storeApp.kind == "mac-software" {
|
||||||
let requiredVersion = OperatingSystemVersion(majorVersion: osVersion.major, minorVersion: osVersion.minor,
|
let requiredVersion = OperatingSystemVersion(
|
||||||
patchVersion: osVersion.patch)
|
majorVersion: osVersion.major,
|
||||||
|
minorVersion: osVersion.minor,
|
||||||
|
patchVersion: osVersion.patch
|
||||||
|
)
|
||||||
// Don't consider an app outdated if the version in the app store requires a higher OS version.
|
// Don't consider an app outdated if the version in the app store requires a higher OS version.
|
||||||
guard ProcessInfo.processInfo.isOperatingSystemAtLeast(requiredVersion) else {
|
guard ProcessInfo.processInfo.isOperatingSystemAtLeast(requiredVersion) else {
|
||||||
return false
|
return false
|
||||||
|
|
|
@ -18,8 +18,13 @@ public class SoftwareProductSpec: QuickSpec {
|
||||||
MasKit.initialize()
|
MasKit.initialize()
|
||||||
}
|
}
|
||||||
describe("software product") {
|
describe("software product") {
|
||||||
let app = SoftwareProductMock(appName: "App", bundleIdentifier: "", bundlePath: "", bundleVersion: "1.0.0",
|
let app = SoftwareProductMock(
|
||||||
itemIdentifier: 111)
|
appName: "App",
|
||||||
|
bundleIdentifier: "",
|
||||||
|
bundlePath: "",
|
||||||
|
bundleVersion: "1.0.0",
|
||||||
|
itemIdentifier: 111
|
||||||
|
)
|
||||||
|
|
||||||
let currentApp = SearchResult(kind: "mac-software", version: "1.0.0")
|
let currentApp = SearchResult(kind: "mac-software", version: "1.0.0")
|
||||||
let appUpdate = SearchResult(kind: "mac-software", version: "2.0.0")
|
let appUpdate = SearchResult(kind: "mac-software", version: "2.0.0")
|
||||||
|
|
Loading…
Reference in a new issue