fix: relaunch app after debug restart
This commit is contained in:
@@ -160,10 +160,10 @@ enum DebugActions {
|
|||||||
static func restartApp() {
|
static func restartApp() {
|
||||||
let url = Bundle.main.bundleURL
|
let url = Bundle.main.bundleURL
|
||||||
let task = Process()
|
let task = Process()
|
||||||
task.launchPath = "/usr/bin/open"
|
// Relaunch shortly after this instance exits so we get a true restart even in debug.
|
||||||
task.arguments = [url.path]
|
task.launchPath = "/bin/sh"
|
||||||
|
task.arguments = ["-c", "sleep 0.2; open -n \"$1\"", "_", url.path]
|
||||||
try? task.run()
|
try? task.run()
|
||||||
task.waitUntilExit()
|
|
||||||
NSApp.terminate(nil)
|
NSApp.terminate(nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user