You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
676 B
Rust
21 lines
676 B
Rust
|
|
use std::{env, fs, path::Path};
|
|
|
|
fn main()
|
|
{
|
|
let out_path = format!("target/{}", &env::var("PROFILE").unwrap());
|
|
let out_path = Path::new(&out_path);
|
|
let out_path_data = out_path.join(Path::new("data"));
|
|
|
|
if !out_path_data.exists()
|
|
{
|
|
fs::create_dir(&out_path_data).expect(&format!("Could not create data directory at: {}", out_path_data.to_string_lossy()));
|
|
}
|
|
|
|
for file in fs::read_dir("data").unwrap()
|
|
{
|
|
let file = file.unwrap();
|
|
let dest = out_path.join(file.path());
|
|
fs::copy(file.path(), &dest).expect(&format!("Could not copy file {} to {}", file.path().to_string_lossy(), dest.to_string_lossy()));
|
|
}
|
|
} |