Skip to content

Commit

Permalink
better static artefact caching
Browse files Browse the repository at this point in the history
this should speedup hot builds and ci builds

improves cache usage
  • Loading branch information
lovasoa committed Jun 23, 2024
1 parent c6f3fea commit e582fc9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,14 @@ fn hashed_filename(path: &Path) -> String {
}

fn make_url_path(url: &str) -> PathBuf {
let filename = url.replace(|c: char| !c.is_ascii_alphanumeric() && c != '.', "_");
Path::new(&std::env::var("OUT_DIR").unwrap()).join(filename)
let manifest_dir = env!("CARGO_MANIFEST_DIR");
let sqlpage_artefacts = Path::new(&manifest_dir)
.join("target")
.join("sqlpage_artefacts");
std::fs::create_dir_all(&sqlpage_artefacts).unwrap();
let filename = url.replace(
|c: char| !c.is_ascii_alphanumeric() && !['.', '-'].contains(&c),
"_",
);
sqlpage_artefacts.join(filename)
}

0 comments on commit e582fc9

Please sign in to comment.