use std::{env, fs, path::Path}; fn main() { let args:Vec=env::args().collect(); if args.len()!=3{eprintln!("usage: inject_webroot "); 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(); }