craby_cli 0.1.0-beta.8

Craby CLI
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::path::Path;

use crate::utils::git::is_git_available;

pub fn validate_env(dest_dir: &Path) -> anyhow::Result<()> {
    if dest_dir.try_exists()? {
        anyhow::bail!("{} directory already exists", dest_dir.display());
    }

    if !is_git_available() {
        anyhow::bail!("Git command is not available. Please install Git and try again.");
    }

    Ok(())
}