mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-06-26 18:24:48 +03:00
Compare commits
1 Commits
lan-mouse-
...
main-dbeae
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dbeaea03ad |
@@ -1,6 +1,7 @@
|
|||||||
use crate::capture_test::TestCaptureArgs;
|
use crate::capture_test::TestCaptureArgs;
|
||||||
use crate::emulation_test::TestEmulationArgs;
|
use crate::emulation_test::TestEmulationArgs;
|
||||||
use clap::{Parser, Subcommand, ValueEnum};
|
use clap::{Parser, Subcommand, ValueEnum};
|
||||||
|
use notify::event::ModifyKind;
|
||||||
use notify::{EventKind, RecommendedWatcher, Watcher};
|
use notify::{EventKind, RecommendedWatcher, Watcher};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
@@ -406,7 +407,9 @@ impl Config {
|
|||||||
if event.paths.contains(&self.config_path)
|
if event.paths.contains(&self.config_path)
|
||||||
&& matches!(
|
&& matches!(
|
||||||
event.kind,
|
event.kind,
|
||||||
EventKind::Create(_) | EventKind::Modify(_) | EventKind::Remove(_)
|
EventKind::Create(_)
|
||||||
|
| EventKind::Modify(ModifyKind::Data(_))
|
||||||
|
| EventKind::Remove(_)
|
||||||
)
|
)
|
||||||
&& self.read_from_disk()?
|
&& self.read_from_disk()?
|
||||||
{
|
{
|
||||||
@@ -524,6 +527,11 @@ impl Config {
|
|||||||
}
|
}
|
||||||
Err(e) => log::warn!("{:?} {e}", self.config_path()),
|
Err(e) => log::warn!("{:?} {e}", self.config_path()),
|
||||||
};
|
};
|
||||||
|
if changed {
|
||||||
|
log::info!("config changed");
|
||||||
|
} else {
|
||||||
|
log::info!("config unchanged");
|
||||||
|
}
|
||||||
Ok(changed)
|
Ok(changed)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user