-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.rs
More file actions
34 lines (27 loc) · 733 Bytes
/
Copy pathbuild.rs
File metadata and controls
34 lines (27 loc) · 733 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
use anyhow::*;
use fs_extra::copy_items;
use fs_extra::dir::CopyOptions;
use std::env;
fn main() -> Result<()>
{
// This tells cargo to rerun this script if something in resources/ changes
println!("cargo:rerun-if-changed=resources/*");
let target = env::var("TARGET").unwrap();
let out_dir;
if target.contains("wasm32")
{
out_dir = "pkg".to_string();
}
else
{
out_dir = env::var("OUT_DIR")?;
}
dbg!(" START ...");
let mut copy_options = CopyOptions::new();
copy_options.overwrite = true;
let mut paths_to_copy = Vec::new();
paths_to_copy.push("resources/");
copy_items(&paths_to_copy, out_dir, ©_options)?;
dbg!(" END ...");
Ok(())
}