🐛 fix: run shortcut and desktop wizards after default config too
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing

The shortcut/desktop setup was only offered when the user chose the
interactive wizard path; the default config path skipped them entirely.

Move both setup_shortcut_wizard and setup_desktop_integration_wizard
calls out of run_wizard and into ensure_config_exists so they always
run after the config file is written, regardless of the setup mode chosen.
This commit is contained in:
2026-03-01 21:37:14 -03:00
parent 2d7d49d548
commit 2abf7e77b4
4 changed files with 16 additions and 15 deletions
+9 -13
View File
@@ -107,6 +107,14 @@ impl Config {
Self::run_wizard(&config_path)?;
}
}
// Offer shortcut and desktop integration regardless of setup mode
if let Err(e) = crate::shortcut::setup_shortcut_wizard() {
eprintln!("Warning: shortcut setup failed: {}", e);
}
if let Err(e) = crate::shortcut::setup_desktop_integration_wizard() {
eprintln!("Warning: desktop integration failed: {}", e);
}
}
Ok(config_path)
@@ -147,19 +155,7 @@ impl Config {
let toml_string = toml::to_string_pretty(&config).context("Failed to serialize config")?;
fs::write(config_path, toml_string)
.with_context(|| format!("Failed to write config file: {}", config_path.display()))?;
// Offer to set up a keyboard shortcut (best-effort, non-fatal)
if let Err(e) = crate::shortcut::setup_shortcut_wizard() {
eprintln!("Warning: shortcut setup failed: {}", e);
}
// Offer to install .desktop entry + icon (best-effort, non-fatal)
if let Err(e) = crate::shortcut::setup_desktop_integration_wizard() {
eprintln!("Warning: desktop integration failed: {}", e);
}
Ok(())
.with_context(|| format!("Failed to write config file: {}", config_path.display()))
}
fn prompt_for_paths() -> Result<Vec<String>> {