We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9508964 commit 7523e6cCopy full SHA for 7523e6c
rewatch/src/watcher.rs
@@ -32,10 +32,17 @@ fn is_rescript_file(path_buf: &Path) -> bool {
32
}
33
34
fn is_in_build_path(path_buf: &Path) -> bool {
35
- path_buf
36
- .to_str()
37
- .map(|x| x.contains("/lib/bs/") || x.contains("/lib/ocaml/"))
38
- .unwrap_or(false)
+ let mut prev_component: Option<&std::ffi::OsStr> = None;
+ for component in path_buf.components() {
+ let comp_os = component.as_os_str();
+ if let Some(prev) = prev_component {
39
+ if prev == "lib" && (comp_os == "bs" || comp_os == "ocaml") {
40
+ return true;
41
+ }
42
43
+ prev_component = Some(comp_os);
44
45
+ false
46
47
48
fn matches_filter(path_buf: &Path, filter: &Option<regex::Regex>) -> bool {
0 commit comments