Skip to content

Commit

Permalink
chore: improve error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
CinematicCow committed Mar 18, 2024
1 parent cde051c commit 28dac08
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/commands/new/parachain.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use crate::{
engines::parachain_engine::{instantiate_template_dir, Config}, helpers::git_init, style::{style, Theme}
engines::parachain_engine::{instantiate_template_dir, Config},
helpers::git_init,
style::{style, Theme},
};
use clap::{Args, Parser};
use std::{fs, path::Path};
Expand Down Expand Up @@ -76,7 +78,11 @@ impl NewParachainCommand {
initial_endowment: self.initial_endowment.clone().expect("default values"),
},
)?;
git_init(destination_path, "initialized parachain")?;
if let Err(err) = git_init(destination_path, "initialized parachain") {
if err.class() == git2::ErrorClass::Config && err.code() == git2::ErrorCode::NotFound {
outro_cancel("git signature could not be found. Please configure your git config with your name and email")?;
}
}
spinner.stop("Generation complete");
outro(format!("cd into \"{}\" and enjoy hacking! 🚀", &self.name))?;
Ok(())
Expand Down

0 comments on commit 28dac08

Please sign in to comment.