Git support (#143)

This commit is contained in:
Gregory Schier
2025-02-07 07:59:48 -08:00
committed by GitHub
parent cffc7714c1
commit 1a7c27663a
111 changed files with 4264 additions and 372 deletions

View File

@@ -45,9 +45,19 @@ pub(crate) async fn watch_directory(
Some(event_res) = async_rx.recv() => {
match event_res {
Ok(event) => {
// Filter out any ignored directories and see if we still get a result
let paths = event.paths.into_iter()
.map(|p| p.strip_prefix(&dir).unwrap().to_path_buf())
.filter(|p| !p.starts_with(".git") && !p.starts_with("node_modules"))
.collect::<Vec<PathBuf>>();
if paths.is_empty() {
continue;
}
channel
.send(WatchEvent {
paths: event.paths,
paths,
kind: format!("{:?}", event.kind),
})
.expect("Failed to send watch event");