auric 0.1.1

CLI for the `auric` MVC SPA framework
use crate::cmd;
use clap::Parser;
use std::path::Path;
use tokio::fs;

#[derive(Debug, Parser)]
pub struct Opts {
    /// App Name
    #[arg(value_name = "app-name")]
    pub app_name: String,
}

pub async fn run(app_name: String) -> anyhow::Result<()> {
    // Create subdir
    let path = Path::new(&app_name);
    fs::create_dir_all(path).await?;

    // Run init
    cmd::init::run(Some(path), Some(app_name.clone())).await?;

    Ok(())
}