mirror of
https://github.com/neodyland/sbv2-api.git
synced 2026-01-04 13:32:57 +00:00
revert
This commit is contained in:
@@ -43,5 +43,4 @@ aivmx = ["npyz", "base64"]
|
||||
base64 = ["dep:base64"]
|
||||
|
||||
[build-dependencies]
|
||||
ureq = "3.0.6"
|
||||
home-dir = "0.1.0"
|
||||
ureq = "3.0.6"
|
||||
@@ -1,17 +1,12 @@
|
||||
use std::env;
|
||||
use std::fs::{self, hard_link};
|
||||
use std::fs;
|
||||
use std::io::copy;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use home_dir::HomeDirExt;
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let out_dir = "~/.cache/sbv2-api-assets".expand_home().unwrap();
|
||||
let out_dir = PathBuf::from(&env::var("OUT_DIR").unwrap());
|
||||
let out_path = out_dir.join("all.bin");
|
||||
if !out_path.exists() {
|
||||
if !out_dir.exists() {
|
||||
fs::create_dir_all(out_dir).unwrap();
|
||||
}
|
||||
println!("cargo:warning=Downloading dictionary file...");
|
||||
let mut response =
|
||||
ureq::get("https://huggingface.co/neody/sbv2-api-assets/resolve/main/dic/all.bin")
|
||||
@@ -20,11 +15,6 @@ 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