mirror of
https://github.com/neodyland/sbv2-api.git
synced 2026-01-07 06:52:57 +00:00
fix: reduce download
This commit is contained in:
@@ -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"
|
||||
@@ -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(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user