MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / vendor_runtime

Function vendor_runtime

cli/src/build.rs:88–99  ·  view source on GitHub ↗

Fetch the runtime JS modules into `dist/runtime/` mirroring their CDN layout.

(out_dir: &Path)

Source from the content-addressed store, hash-verified

86
87/// Fetch the runtime JS modules into `dist/runtime/` mirroring their CDN layout.
88fn vendor_runtime(out_dir: &Path) -> Result<()> {
89 for rel in RUNTIME_FILES {
90 let url = format!("{RUNTIME_BASE}{rel}");
91 let bytes = fetch(&url).with_context(|| format!("fetching {url}"))?;
92 let path = out_dir.join("runtime").join(rel);
93 if let Some(p) = path.parent() {
94 fs::create_dir_all(p)?;
95 }
96 fs::write(&path, bytes)?;
97 }
98 Ok(())
99}
100
101/// Walk the project for `.py` files; skip hidden dirs and the output directory itself.
102fn collect_scripts(project: &Path, out_dir: &Path) -> Vec<PathBuf> {

Callers 1

runFunction · 0.85

Calls 1

fetchFunction · 0.85

Tested by

no test coverage detected