pub fn apply_all(target: &Path, dryrun: bool) -> Result<()> {
    let target = target.to_path_buf();

    // Scan recursively for config files (.yaml for .yml) in target directory
    let mut config_files = Vec::new();
    for entry in std::fs::read_dir(target)? {
        let entry = entry?;
        let path = entry.path();
        if path.is_file() {
            let ext = path.extension().unwrap();
            if ext == "yaml" || ext == "yml" {
                config_files.push(path);
            }
        }
    }

    // Apply each config file
    for config_file in config_files {
        info!("Applying configuration from {}", config_file.display());
        apply(&config_file, dryrun)?;
    }

    Ok(())
}
/// Apply all config files from the given directory.
Apply all config files from the given directory.
Apply all config files from the given directory .
pub fn apply_all(target: &Path, dryrun: bool) -> Result<()> {
    let target = target.to_path_buf();
    // Scan recursively for config files (.yaml for .yml) in target directory
    let mut config_files = Vec::new();
    for entry in std::fs::read_dir(target)? {
        let entry = entry?;
        let path = entry.path();
        if path.is_file() {
            let ext = path.extension().unwrap();
            if ext == "yaml" || ext == "yml" {
                config_files.push(path);
            }
        }
    }
    // Apply each config file
    for config_file in config_files {
        info!("Applying configuration from {}", config_file.display());
        apply(&config_file, dryrun)?;
    }
    Ok(())
}
pub fn apply_all ( target : & Path , dryrun : bool ) -> Result < ( ) > { let target = target . to_path_buf ( ) ; // Scan recursively for config files (.yaml for .yml) in target directory let mut config_files = Vec :: new ( ) ; for entry in std :: fs :: read_dir ( target ) ? { let entry = entry ? ; let path = entry . path ( ) ; if path . is_file ( ) { let ext = path . extension ( ) . unwrap ( ) ; if ext == " " || ext == " " { config_files . push ( path ) ; } } } // Apply each config file for config_file in config_files { info ! ( " " config_file display ( ) ) ; apply ( & config_file , dryrun ) ? ; } Ok ( ( ) ) }
Apply all config files from the given directory.
Apply all config files from the given directory .
target
&Path
dryrun
bool
target
&Path
dryrun
bool