pub fn gen(target: &Path) {
    let target = target.to_path_buf();

    // Skip if target already exists
    if target.exists() {
        info!("target already exists");
        return;
    }

    fs::create_dir_all(&target).unwrap_or_else(|_| panic!("failed to generate {:?}", &target));
    info!("creating path: {:?}", target);

    let config = Config::default();
    let config_str = serde_yaml::to_string(&config).unwrap();

    // Write config_str to target/config.yml
    let config_path = target.join("config.yml");
    fs::write(config_path.clone(), config_str)
        .unwrap_or_else(|_| panic!("failed to write {:?}", config_path));
    info!("Generated: {:?}", config_path);
}
/// Generate project template to given target
Generate project template to given target
Generate project template to given target
pub fn gen(target: &Path) {
    let target = target.to_path_buf();
    // Skip if target already exists
    if target.exists() {
        info!("target already exists");
        return;
    }
    fs::create_dir_all(&target).unwrap_or_else(|_| panic!("failed to generate {:?}", &target));
    info!("creating path: {:?}", target);
    let config = Config::default();
    let config_str = serde_yaml::to_string(&config).unwrap();
    // Write config_str to target/config.yml
    let config_path = target.join("config.yml");
    fs::write(config_path.clone(), config_str)
        .unwrap_or_else(|_| panic!("failed to write {:?}", config_path));
    info!("Generated: {:?}", config_path);
}
pub fn gen ( target : & Path ) { let target = target . to_path_buf ( ) ; // Skip if target already exists if target . exists ( ) { info ! ( " " ) ; return ; } fs :: create_dir_all ( & target ) . unwrap_or_else ( | _ | panic ! ( " " target ) ) ; info ! ( " " target ) ; let config = Config :: default ( ) ; let config_str = serde_yaml :: to_string ( & config ) . unwrap ( ) ; // Write config_str to target/config.yml let config_path = target . join ( " " ) ; fs :: write ( config_path . clone ( ) , config_str ) . unwrap_or_else ( | _ | panic ! ( " " config_path ) ) ; info ! ( " " config_path ) ; }
Generate project template to given target
Generate project template to given target
target
&Path
target
&Path