filesentry 0.2.2

robust (recursive) file watcher
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
fn main() {
    // Declare the custom cfg for check-cfg
    println!("cargo::rustc-check-cfg=cfg(watcher_disable)");

    // Disable the watcher if:
    // 1. We're not on Linux (inotify is Linux-only)
    // 2. The FILESENTRY_DISABLE environment variable is set (for testing)
    let disable = !cfg!(target_os = "linux")
        || std::env::var("FILESENTRY_DISABLE").is_ok();

    if disable {
        println!("cargo::rustc-cfg=watcher_disable");
    }

    // Re-run if the environment variable changes
    println!("cargo::rerun-if-env-changed=FILESENTRY_DISABLE");
}