diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs index 5b0ddba..c0ee15a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -102,11 +102,13 @@ async fn main() -> Result<()> { let repo = git2::Repository::discover(PathBuf::from(".")) .map_err(|e| match e.code() { - git2::ErrorCode::NotFound => anyhow!("Failed to load the git repository from ./."), + git2::ErrorCode::NotFound => { + eprintln!("Butido must be executed within the package repository"); + std::process::exit(1) + }, _ => Error::from(e), - }) - .context("Loading the git repository") - .context("Butido must be executed within the package repository")?; + })?; + let repo_path = repo .workdir() .ok_or_else(|| anyhow!("Not a repository with working directory. Cannot do my job!"))?; |