Copy each `.py` preserving its path under the project root.
(scripts: &[PathBuf], project: &Path, out_dir: &Path)
| 185 | |
| 186 | /// Copy each `.py` preserving its path under the project root. |
| 187 | fn copy_scripts(scripts: &[PathBuf], project: &Path, out_dir: &Path) -> Result<usize> { |
| 188 | let mut count = 0usize; |
| 189 | for s in scripts { |
| 190 | let rel = s.strip_prefix(project).unwrap_or(s); |
| 191 | let dest = out_dir.join(rel); |
| 192 | if let Some(p) = dest.parent() { |
| 193 | fs::create_dir_all(p)?; |
| 194 | } |
| 195 | fs::copy(s, &dest)?; |
| 196 | count += 1; |
| 197 | } |
| 198 | Ok(count) |
| 199 | } |
| 200 | |
| 201 | /// Overlay vendored entries on top of the user's manifest; vendored paths win. |
| 202 | fn rewrite_manifest( |