doom-eternal 0.1.0

Rust CLI for the Xylex DOOM Eternal texture and install workflow
Documentation
use crate::{
    console::Console,
    paths::{RepoContext, resolve_repo_root},
};

#[derive(Debug, Clone)]
pub struct AppContext {
    repo: RepoContext,
    console: Console,
}

impl AppContext {
    pub fn discover() -> Self {
        let repo = RepoContext::discover();
        let console = Console::new(repo.root().to_path_buf());
        Self { repo, console }
    }

    pub fn from_anchor(anchor: impl AsRef<std::path::Path>) -> Self {
        let repo_root = resolve_repo_root(anchor);
        let repo = RepoContext::from_anchor(&repo_root);
        let console = Console::new(repo_root);
        Self { repo, console }
    }

    pub fn repo(&self) -> &RepoContext {
        &self.repo
    }

    pub fn console(&self) -> &Console {
        &self.console
    }
}