(path: &Path)
| 64 | } |
| 65 | |
| 66 | fn emit_rerun_tree(path: &Path) -> Result<(), Box<dyn std::error::Error>> { |
| 67 | if !path.exists() { |
| 68 | return Ok(()); |
| 69 | } |
| 70 | println!("cargo:rerun-if-changed={}", path.display()); |
| 71 | for entry in fs::read_dir(path)? { |
| 72 | let entry = entry?; |
| 73 | let child = entry.path(); |
| 74 | if entry.file_type()?.is_dir() { |
| 75 | let name = entry.file_name(); |
| 76 | let name = name.to_string_lossy(); |
| 77 | if matches!(name.as_ref(), "node_modules" | "build" | "dist") { |
| 78 | continue; |
| 79 | } |
| 80 | emit_rerun_tree(&child)?; |
| 81 | } else { |
| 82 | emit_rerun_if_changed(&child)?; |
| 83 | } |
| 84 | } |
| 85 | Ok(()) |
| 86 | } |
| 87 | |
| 88 | fn emit_rerun_if_changed(path: &Path) -> Result<(), Box<dyn std::error::Error>> { |
| 89 | println!("cargo:rerun-if-changed={}", path.display()); |
no test coverage detected