feat: add Finder, ranking reset, and quit actions
This commit is contained in:
@@ -18,4 +18,17 @@ enum AppLauncher {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static func quit(_ url: URL) throws {
|
||||
let path = url.standardizedFileURL.resolvingSymlinksInPath().path
|
||||
for application in NSWorkspace.shared.runningApplications {
|
||||
guard application.bundleURL?.standardizedFileURL.resolvingSymlinksInPath().path == path,
|
||||
!application.isTerminated else { continue }
|
||||
guard application.terminate() else {
|
||||
throw NSError(domain: "Conjure", code: 1, userInfo: [
|
||||
NSLocalizedDescriptionKey: "The application refused the quit request. Save your work and quit it manually."
|
||||
])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user