fix: create ~/.config/lan-mouse/ on first launch

notify::Watcher fails on macOS if the config directory doesn't
exist. Create it with create_dir_all before calling config.watch().

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jon Kinney
2026-04-24 02:08:59 -05:00
committed by Ferdinand Schober
parent f858a7de00
commit c40e10505b

View File

@@ -362,6 +362,11 @@ impl Config {
.parent()
.expect("config directory")
.to_path_buf();
// notify::Watcher requires the directory to exist on macOS (FSEvents)
// and some Linux backends. Create it eagerly so a first launch on a
// fresh machine — where ~/.config/lan-mouse/ has never been touched —
// doesn't surface as a notify::Error out of Config::new().
fs::create_dir_all(&config_dir)?;
let mut config = Config {
args,
cert_path,