(src: &Path, dst: &Path)
| 146 | } |
| 147 | |
| 148 | fn 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 | |
| 186 | pub fn regen_dlls() -> Result<()> { |
| 187 | let workspace = workspace_dir(); |
no test coverage detected
searching dependent graphs…