diff --git a/crates/cuddle-please/src/command.rs b/crates/cuddle-please/src/command.rs index c38b693..3fd7637 100644 --- a/crates/cuddle-please/src/command.rs +++ b/crates/cuddle-please/src/command.rs @@ -221,6 +221,20 @@ impl Command { } } } + Some(Commands::Doctor {}) => { + match std::process::Command::new("git").arg("-v").output() { + Ok(o) => { + let stdout = std::str::from_utf8(&o.stdout).unwrap_or("".into()); + self.ui.write_str_ln(&format!("OK: {}", stdout)); + } + Err(e) => { + self.ui.write_str_ln(&format!( + "WARNING: git is not installed: {}", + e.to_string() + )); + } + } + } None => { tracing::debug!("running bare command"); // 2. Parse the cuddle.please.yaml let cuddle.please.yaml take precedence @@ -277,6 +291,8 @@ enum Commands { #[command(subcommand)] command: GiteaCommand, }, + /// Helps you identify missing things from your execution environment for cuddle-please to function as intended + Doctor {}, } #[derive(Subcommand, Debug, Clone)]