Skip to content

Commit

Permalink
Make restarting more reliable
Browse files Browse the repository at this point in the history
Passing `-n` to `open` makes sure that even if
the current instance of app is running, we launch
the new instance.

Previously, restart worked only if `open` was invoked,
but somehow it hadn't gotten around to launching the
fresh instance, and thus current instance had time to
terminate.
  • Loading branch information
mr-pennyworth committed Aug 4, 2024
1 parent f62d15e commit 6934cc6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions AlfredExtraPane.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 0.2.4;
MARKETING_VERSION = 0.2.5;
ONLY_ACTIVE_ARCH = NO;
OTHER_CODE_SIGN_FLAGS = "--deep";
PRODUCT_BUNDLE_IDENTIFIER = mr.pennyworth.AlfredExtraPane;
Expand All @@ -434,7 +434,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 0.2.4;
MARKETING_VERSION = 0.2.5;
ONLY_ACTIVE_ARCH = NO;
OTHER_CODE_SIGN_FLAGS = "--deep";
PRODUCT_BUNDLE_IDENTIFIER = mr.pennyworth.AlfredExtraPane;
Expand Down
2 changes: 1 addition & 1 deletion AlfredExtraPane/Menu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ extension AppDelegate {
@objc func restart() {
let task = Process()
task.launchPath = "/usr/bin/open"
task.arguments = [Bundle.main.bundlePath]
task.arguments = ["-n", Bundle.main.bundlePath]
task.launch()
NSApplication.shared.terminate(nil)
}
Expand Down

0 comments on commit 6934cc6

Please sign in to comment.