mirror of
https://github.com/XcodesOrg/XcodesApp.git
synced 2026-03-25 08:55:46 +00:00
Initialize SUUpdater and add check for updates menu item
This commit is contained in:
parent
e7eea3bee1
commit
b3dbb1af45
2 changed files with 18 additions and 1 deletions
|
|
@ -37,5 +37,7 @@
|
|||
<key>com.robotsandpencils.XcodesApp.Helper</key>
|
||||
<string>identifier "com.robotsandpencils.XcodesApp.Helper" and info [CFBundleShortVersionString] >= "1.0.0" and anchor apple generic and certificate leaf[subject.OU] = "$(CODE_SIGNING_SUBJECT_ORGANIZATIONAL_UNIT)"</string>
|
||||
</dict>
|
||||
<key>SUFeedURL</key>
|
||||
<string>https://robotsandpencils.github.io/XcodesApp/appcast.xml</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import SwiftUI
|
||||
import AppKit
|
||||
import Sparkle
|
||||
import SwiftUI
|
||||
|
||||
@main
|
||||
struct XcodesApp: App {
|
||||
|
|
@ -28,6 +29,11 @@ struct XcodesApp: App {
|
|||
appDelegate.showAboutWindow()
|
||||
}
|
||||
}
|
||||
CommandGroup(after: .appInfo) {
|
||||
Button("Check for Updates...") {
|
||||
appDelegate.checkForUpdates()
|
||||
}
|
||||
}
|
||||
CommandGroup(after: CommandGroupPlacement.newItem) {
|
||||
Button("Refresh") {
|
||||
appState.update()
|
||||
|
|
@ -83,4 +89,13 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
|||
acknowledgementsWindow.center()
|
||||
acknowledgementsWindow.makeKeyAndOrderFront(nil)
|
||||
}
|
||||
|
||||
func checkForUpdates() {
|
||||
SUUpdater.shared()?.checkForUpdates(self)
|
||||
}
|
||||
|
||||
func applicationDidFinishLaunching(_ notification: Notification) {
|
||||
// Initialize manually
|
||||
SUUpdater.shared()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue