fn copy_file()

in proxy_agent_setup/src/linux.rs [49:66]


fn copy_file(src_file: PathBuf, dst_file: PathBuf) {
    if let Some(p) = dst_file.parent() {
        if let Err(e) = misc_helpers::try_create_folder(p) {
            logger::write(format!("Failed to create folder {:?}, error: {:?}", p, e));
        }
    }
    match fs::copy(&src_file, &dst_file) {
        Ok(_) => {
            logger::write(format!("Copied file {:?} to {:?}", src_file, dst_file));
        }
        Err(e) => {
            logger::write(format!(
                "Failed to copy file {:?} to {:?}, error: {:?}",
                src_file, dst_file, e
            ));
        }
    }
}