fix(core): fix wrong handler override on macOS bundle

This commit is contained in:
Federico Terzi 2021-06-26 22:40:38 +02:00
parent a8522720a2
commit 4734eabb0d

View File

@ -325,12 +325,12 @@ fn main() {
.find(|cli| matches.subcommand_matches(&cli.subcommand).is_some());
// When started from the macOS App Bundle, override the default
// handler with "launcher", otherwise the GUI could not be started.
// handler with "launcher" if not present, otherwise the GUI could not be started.
if handler.is_none() {
if let Some(context) = std::env::var_os("MAC_LAUNCH_CONTEXT") {
if context == "bundle" {
handler = CLI_HANDLERS
.iter()
.find(|cli| cli.subcommand == "launcher");
handler = CLI_HANDLERS.iter().find(|cli| cli.subcommand == "launcher");
}
}
}