MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / emit_rerun_tree

Function emit_rerun_tree

vmm/build.rs:66–86  ·  view source on GitHub ↗
(path: &Path)

Source from the content-addressed store, hash-verified

64}
65
66fn 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
88fn emit_rerun_if_changed(path: &Path) -> Result<(), Box<dyn std::error::Error>> {
89 println!("cargo:rerun-if-changed={}", path.display());

Callers 1

build_consoleFunction · 0.85

Calls 2

emit_rerun_if_changedFunction · 0.85
pathMethod · 0.80

Tested by

no test coverage detected