build.rs: always fetch

This commit is contained in:
hosted-fornet 2024-01-08 11:41:24 -08:00
parent 0db7610322
commit 3638f9a0bd

View File

@ -139,12 +139,11 @@ fn main() {
let wit_dir = pwd.join("wit");
fs::create_dir_all(&wit_dir).unwrap();
let wit_file = wit_dir.join("uqbar.wit");
if !wit_file.exists() {
let mut wit_file = std::fs::File::create(&wit_file).unwrap();
let uqbar_wit_url = "https://raw.githubusercontent.com/uqbar-dao/uqwit/master/uqbar.wit";
let mut response = reqwest::blocking::get(uqbar_wit_url).unwrap();
io::copy(&mut response, &mut wit_file).unwrap();
}
//if !wit_file.exists() { // TODO: cache in better way
let mut wit_file = std::fs::File::create(&wit_file).unwrap();
let uqbar_wit_url = "https://raw.githubusercontent.com/uqbar-dao/uqwit/master/uqbar.wit";
let mut response = reqwest::blocking::get(uqbar_wit_url).unwrap();
io::copy(&mut response, &mut wit_file).unwrap();
// Create target.wasm (compiled .wit) & world
run_command(Command::new("wasm-tools").args([