actr-cli 0.1.15

Command line tool for Actor-RTC framework projects
Documentation
use crate::error::Result;
use crate::templates::ProjectTemplate;
use std::collections::HashMap;
use std::path::Path;

pub fn load(files: &mut HashMap<String, String>) -> Result<()> {
    let fixtures_root = Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures");

    // Cargo.toml
    ProjectTemplate::load_file(
        &fixtures_root.join("rust/Cargo.toml.hbs"),
        files,
        "Cargo.toml",
    )?;

    // src/lib.rs
    ProjectTemplate::load_file(&fixtures_root.join("rust/lib.rs.hbs"), files, "src/lib.rs")?;

    // Actr.toml
    ProjectTemplate::load_file(
        &fixtures_root.join("rust/echo/Actr.toml.hbs"),
        files,
        "Actr.toml",
    )?;

    // build.rs
    ProjectTemplate::load_file(&fixtures_root.join("rust/build.rs.hbs"), files, "build.rs")?;

    // README.md
    ProjectTemplate::load_file(
        &fixtures_root.join("rust/echo/README.md.hbs"),
        files,
        "README.md",
    )?;

    // .gitignore
    ProjectTemplate::load_file(
        &fixtures_root.join("rust/gitignore.hbs"),
        files,
        ".gitignore",
    )?;

    Ok(())
}