Skip to content

Commit

Permalink
asynchronousSoftwareUpdate
Browse files Browse the repository at this point in the history
  • Loading branch information
erikng committed Jan 21, 2022
1 parent 2c78b1d commit 55cc93b
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Example Assets/com.github.macadmins.Nudge.json
Expand Up @@ -4,7 +4,7 @@
"us.zoom.xos"
],
"aggressiveUserExperience": true,
"asyncronousSoftwareUpdate": true,
"asynchronousSoftwareUpdate": true,
"attemptToFetchMajorUpgrade": true,
"enforceMinorUpdates": true
},
Expand Down
2 changes: 1 addition & 1 deletion Example Assets/com.github.macadmins.Nudge.mobileconfig
Expand Up @@ -27,7 +27,7 @@
</array>
<key>aggressiveUserExperience</key>
<true/>
<key>asyncronousSoftwareUpdate</key>
<key>asynchronousSoftwareUpdate</key>
<true/>
<key>attemptToFetchMajorUpgrade</key>
<true/>
Expand Down
2 changes: 1 addition & 1 deletion Nudge/Preferences/DefaultPreferencesNudge.swift
Expand Up @@ -16,7 +16,7 @@ let optionalFeaturesProfile = getOptionalFeaturesProfile()
let optionalFeaturesJSON = getOptionalFeaturesJSON()
let aggressiveUserExperience = optionalFeaturesProfile?["aggressiveUserExperience"] as? Bool ?? optionalFeaturesJSON?.aggressiveUserExperience ?? true
let customAcceptableApplicationBundleIDs = optionalFeaturesProfile?["acceptableApplicationBundleIDs"] as? [String] ?? optionalFeaturesJSON?.acceptableApplicationBundleIDs ?? [""]
let asyncronousSoftwareUpdate = optionalFeaturesProfile?["asyncronousSoftwareUpdate"] as? Bool ?? optionalFeaturesJSON?.asyncronousSoftwareUpdate ?? true
let asynchronousSoftwareUpdate = optionalFeaturesProfile?["asynchronousSoftwareUpdate"] as? Bool ?? optionalFeaturesJSON?.asynchronousSoftwareUpdate ?? true
let attemptToFetchMajorUpgrade = optionalFeaturesProfile?["attemptToFetchMajorUpgrade"] as? Bool ?? optionalFeaturesJSON?.attemptToFetchMajorUpgrade ?? true
let enforceMinorUpdates = optionalFeaturesProfile?["enforceMinorUpdates"] as? Bool ?? optionalFeaturesJSON?.enforceMinorUpdates ?? true

Expand Down
6 changes: 3 additions & 3 deletions Nudge/Preferences/PreferencesStructure.swift
Expand Up @@ -59,7 +59,7 @@ extension NudgePreferences {
// MARK: - OptionalFeatures
struct OptionalFeatures: Codable {
var acceptableApplicationBundleIDs: [String]?
var aggressiveUserExperience, asyncronousSoftwareUpdate, attemptToFetchMajorUpgrade, enforceMinorUpdates: Bool?
var aggressiveUserExperience, asynchronousSoftwareUpdate, attemptToFetchMajorUpgrade, enforceMinorUpdates: Bool?
}

// MARK: OptionalFeatures convenience initializers and mutators
Expand All @@ -83,14 +83,14 @@ extension OptionalFeatures {
func with(
acceptableApplicationBundleIDs: [String]?? = nil,
aggressiveUserExperience: Bool?? = nil,
asyncronousSoftwareUpdate: Bool?? = nil,
asynchronousSoftwareUpdate: Bool?? = nil,
attemptToFetchMajorUpgrade: Bool?? = nil,
enforceMinorUpdates: Bool?? = nil
) -> OptionalFeatures {
return OptionalFeatures(
acceptableApplicationBundleIDs: acceptableApplicationBundleIDs ?? self.acceptableApplicationBundleIDs,
aggressiveUserExperience: aggressiveUserExperience ?? self.aggressiveUserExperience,
asyncronousSoftwareUpdate: asyncronousSoftwareUpdate ?? self.asyncronousSoftwareUpdate,
asynchronousSoftwareUpdate: asynchronousSoftwareUpdate ?? self.asynchronousSoftwareUpdate,
attemptToFetchMajorUpgrade: attemptToFetchMajorUpgrade ?? self.attemptToFetchMajorUpgrade,
enforceMinorUpdates: enforceMinorUpdates ?? self.enforceMinorUpdates
)
Expand Down
2 changes: 1 addition & 1 deletion Nudge/UI/Main.swift
Expand Up @@ -64,7 +64,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
return
}

if asyncronousSoftwareUpdate && Utils().requireMajorUpgrade() == false {
if asynchronousSoftwareUpdate && Utils().requireMajorUpgrade() == false {
DispatchQueue(label: "nudge-su", attributes: .concurrent).asyncAfter(deadline: .now(), execute: {
SoftwareUpdate().Download()
})
Expand Down
2 changes: 1 addition & 1 deletion Schema/jamf/com.github.macadmins.Nudge.json
Expand Up @@ -50,7 +50,7 @@
}
]
},
"asyncronousSoftwareUpdate": {
"asynchronousSoftwareUpdate": {
"description": "When disabled, Nudge will wait for Software Update to finish downloading (if any) updates before showing the UI.",
"anyOf": [
{
Expand Down

0 comments on commit 55cc93b

Please sign in to comment.