fix: restarting the app would sometimes fail to start again
This commit is contained in:
1 parent
96572a8008
commit
56d47fc61c
1 file changed
+4
-7
+4
-7
@@ -102,13 +102,10 @@ class App: AppCenterApplication, NSApplicationDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func restart() {
|
func restart() {
|
||||||
let url = URL(fileURLWithPath: Bundle.main.resourcePath!)
|
// we use -n to open a new instance, to avoid calling applicationShouldHandleReopen
|
||||||
let path = url.deletingLastPathComponent().deletingLastPathComponent().absoluteString
|
// we use Bundle.main.bundlePath in case of multiple AltTab versions on the machine
|
||||||
let task = Process()
|
Process.launchedProcess(launchPath: "/usr/bin/open", arguments: ["-n", Bundle.main.bundlePath])
|
||||||
task.launchPath = "/usr/bin/open"
|
App.shared.terminate(self)
|
||||||
task.arguments = [path]
|
|
||||||
task.launch()
|
|
||||||
exit(0)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func hideUi() {
|
func hideUi() {
|
||||||
|
|||||||
Reference in new issue
Block a user