Thunderstore CLI and Northstar mod dev helper
use std::path::Path;

use anyhow::Result;
use git2::Repository;

pub enum Vcs {
    Git,
    Pijul,
    None,
}

pub fn init_vcs(vcs: &Vcs, path: &Path) -> Result<()> {
    match vcs {
        Vcs::Git => {
            Repository::init(path)?;
        }
        Vcs::Pijul => {
            //This is how cargo does it so it should be good enough for me
            std::process::Command::new("pijul")
                .current_dir(path)
                .arg("init")
                .current_dir(path)
                .output()?;
        }
        Vcs::None => {}
    }

    Ok(())
}