fix: reduce download

This commit is contained in:
Googlefan
2025-02-23 04:48:52 +00:00
parent e262694702
commit 6c5ea9adce
2 changed files with 9 additions and 2 deletions

View File

@@ -43,5 +43,5 @@ aivmx = ["npyz", "base64"]
base64 = ["dep:base64"]
[build-dependencies]
home-dir = "0.1.0"
ureq = "3.0.6"
home-dir = "0.1.0"

View File

@@ -1,5 +1,7 @@
use std::fs;
use std::env;
use std::fs::{self, hard_link};
use std::io::copy;
use std::path::PathBuf;
use home_dir::HomeDirExt;
@@ -18,6 +20,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut file = fs::File::create(&out_path)?;
copy(&mut response, &mut file)?;
}
hard_link(
out_path,
PathBuf::from(&env::var("OUT_DIR").unwrap()).join("out.bin"),
)
.unwrap();
println!("cargo:rerun-if-changed=build.rs");
Ok(())
}