From c23d682514255cc75e8ae7c1502bd5a1ae2a8503 Mon Sep 17 00:00:00 2001 From: dal Date: Thu, 10 Apr 2025 11:52:12 -0600 Subject: [PATCH] git --- cli/cli/src/commands/chat/logic.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cli/cli/src/commands/chat/logic.rs b/cli/cli/src/commands/chat/logic.rs index c320b79fa..0fbadebeb 100644 --- a/cli/cli/src/commands/chat/logic.rs +++ b/cli/cli/src/commands/chat/logic.rs @@ -13,6 +13,7 @@ use std::time::Instant; use thiserror::Error; use tokio::sync::broadcast; use uuid::Uuid; +use std::process::Command; // --- Agent Imports --- use agents::{AgentError, AgentExt, AgentThread, BusterCliAgent}; @@ -106,6 +107,15 @@ pub async fn run_chat(args: ChatArgs) -> Result<()> { .map(|p| p.display().to_string()) .unwrap_or_else(|_| "".to_string()); + // --- Git Repository Check --- + let git_check = Command::new("git") + .args(["rev-parse", "--is-inside-work-tree"]) + .output(); // Use output to capture status and stderr/stdout if needed + + if git_check.is_err() || !git_check.unwrap().status.success() { + println!("{}", colored::Colorize::yellow("Warning: Buster operates best in a git repository.")); + } + // --- Get Credentials --- let (base_url, api_key) = get_api_credentials(&args)?; if api_key.is_none() {