create-lamdera-app-rs 0.1.8

A CLI tool to scaffold Lamdera applications with Tailwind CSS, authentication, i18n, and testing
Documentation
use std::fmt;

pub type Result<T> = anyhow::Result<T>;

#[derive(Debug)]
pub enum Error {
    Io(std::io::Error),
    InvalidProjectName(String),
    GitCommandFailed(String),
    GithubCommandFailed(String),
    TemplateNotFound(String),
    PackageManagerFailed(String),
}

impl fmt::Display for Error {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        match self {
            Error::Io(e) => write!(f, "IO error: {}", e),
            Error::InvalidProjectName(name) => write!(f, "Invalid project name: {}", name),
            Error::GitCommandFailed(msg) => write!(f, "Git command failed: {}", msg),
            Error::GithubCommandFailed(msg) => write!(f, "GitHub command failed: {}", msg),
            Error::TemplateNotFound(path) => write!(f, "Template not found: {}", path),
            Error::PackageManagerFailed(msg) => write!(f, "Package manager failed: {}", msg),
        }
    }
}

impl std::error::Error for Error {}

impl From<std::io::Error> for Error {
    fn from(err: std::io::Error) -> Self {
        Error::Io(err)
    }
}