From c40e10505bad296b5e69a65334a3a81c587c0a4b Mon Sep 17 00:00:00 2001 From: Jon Kinney Date: Fri, 24 Apr 2026 02:08:59 -0500 Subject: [PATCH] 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) --- src/config.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/config.rs b/src/config.rs index 6300aa5..5b02728 100644 --- a/src/config.rs +++ b/src/config.rs @@ -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,