Overlay vendored entries on top of the user's manifest; vendored paths win.
(
manifest: &Manifest,
vendored_imports: &BTreeMap<String, String>,
vendored_host: &BTreeMap<String, String>,
)
| 200 | |
| 201 | /// Overlay vendored entries on top of the user's manifest; vendored paths win. |
| 202 | fn rewrite_manifest( |
| 203 | manifest: &Manifest, |
| 204 | vendored_imports: &BTreeMap<String, String>, |
| 205 | vendored_host: &BTreeMap<String, String>, |
| 206 | ) -> Manifest { |
| 207 | let mut out = Manifest::default(); |
| 208 | for (k, v) in &manifest.imports { out.imports.insert(k.clone(), v.clone()); } |
| 209 | for (k, v) in &manifest.host { out.host.insert(k.clone(), v.clone()); } |
| 210 | for (k, v) in vendored_imports { out.imports.insert(k.clone(), v.clone()); } |
| 211 | for (k, v) in vendored_host { out.host.insert(k.clone(), v.clone()); } |
| 212 | out |
| 213 | } |
| 214 | |
| 215 | /// Pick `main.py`/`app.py`/`index.py` if present; otherwise the first script found. |
| 216 | fn find_entry(scripts: &[PathBuf], project: &Path) -> String { |