viewpoint-core 0.4.3

High-level browser automation API for Viewpoint
Documentation
//! Filesystem utilities for browser launcher.

use std::fs;
use std::path::Path;

/// Recursively copy a directory and its contents.
///
/// This copies files and subdirectories from `src` to `dst`.
/// The destination directory must already exist.
pub fn copy_dir_recursive(src: &Path, dst: &Path) -> std::io::Result<()> {
    for entry in fs::read_dir(src)? {
        let entry = entry?;
        let src_path = entry.path();
        let dst_path = dst.join(entry.file_name());

        if src_path.is_dir() {
            fs::create_dir_all(&dst_path)?;
            copy_dir_recursive(&src_path, &dst_path)?;
        } else {
            fs::copy(&src_path, &dst_path)?;
        }
    }
    Ok(())
}