mirror of
https://github.com/maxgoedjen/secretive.git
synced 2025-04-10 17:47:19 +00:00
Completion
This commit is contained in:
parent
f2092e597a
commit
a3ed59a78c
@ -40,8 +40,9 @@ struct Secretive: App {
|
||||
if hasRunSetup && !agentStatusChecker.running {
|
||||
// We've run setup, we didn't just update, launchd is just not doing it's thing.
|
||||
// Force a launch directly.
|
||||
LaunchAgentController().forceLaunch()
|
||||
agentStatusChecker.check()
|
||||
LaunchAgentController().forceLaunch { _ in
|
||||
agentStatusChecker.check()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,10 +11,11 @@ struct LaunchAgentController {
|
||||
return setEnabled(true)
|
||||
}
|
||||
|
||||
func forceLaunch() {
|
||||
func forceLaunch(completion: ((Bool) -> Void)?) {
|
||||
Logger().debug("Agent is not running, attempting to force launch")
|
||||
let url = Bundle.main.bundleURL.appendingPathComponent("Contents/Library/LoginItems/SecretAgent.app")
|
||||
NSWorkspace.shared.openApplication(at: url, configuration: NSWorkspace.OpenConfiguration()) { app, error in
|
||||
completion?(error == nil)
|
||||
if let error = error {
|
||||
Logger().error("Error force launching \(error.localizedDescription)")
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user