MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / copy_overlay_dir

Function copy_overlay_dir

tools/regen/src/csharp.rs:148–184  ·  view source on GitHub ↗
(src: &Path, dst: &Path)

Source from the content-addressed store, hash-verified

146}
147
148fn copy_overlay_dir(src: &Path, dst: &Path) -> Result<()> {
149 if !src.exists() {
150 bail!("Skeleton directory does not exist: {}", src.display());
151 }
152 if !dst.exists() {
153 bail!("Destination directory does not exist: {}", dst.display());
154 }
155
156 for entry in fs::read_dir(src)? {
157 let entry = entry?;
158 let src_path = entry.path();
159 let dst_path = dst.join(entry.file_name());
160 if entry.file_type()?.is_dir() {
161 if dst_path.exists() {
162 copy_overlay_dir(&src_path, &dst_path)?;
163 }
164 } else {
165 if src_path.extension().is_some_and(|ext| ext == "meta") {
166 let asset_path = dst_path
167 .parent()
168 .expect("dst_path should have a parent")
169 .join(dst_path.file_stem().expect(".meta file should have a file stem"));
170
171 if asset_path.exists() {
172 fs::copy(&src_path, &dst_path)?;
173 } else if dst_path.exists() {
174 fs::remove_file(&dst_path)?;
175 }
176 continue;
177 }
178
179 fs::copy(&src_path, &dst_path)?;
180 }
181 }
182
183 Ok(())
184}
185
186pub fn regen_dlls() -> Result<()> {
187 let workspace = workspace_dir();

Callers 1

Calls 3

joinMethod · 0.80
OkFunction · 0.50
pathMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…