11 lines
449 B
Rust
11 lines
449 B
Rust
use std::{env, fs, path::Path};
|
|
fn main() {
|
|
let args:Vec<String>=env::args().collect();
|
|
if args.len()!=3{eprintln!("usage: inject_webroot <src_dir> <dst_dir>"); std::process::exit(2);}
|
|
let (src,dst)=(&args[1],&args[2]);
|
|
if Path::new(dst).exists(){fs::remove_dir_all(dst).ok();}
|
|
fs::create_dir_all(dst).unwrap();
|
|
fs_extra::dir::copy(src,dst,&fs_extra::dir::CopyOptions{overwrite:true,copy_inside:true, ..Default::default()}).unwrap();
|
|
}
|
|
|