More no-window flags (#7122)
This commit is contained in:
@@ -5,8 +5,10 @@ use goose::recipe::RECIPE_FILE_EXTENSIONS;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use goose::recipe::read_recipe_file_content::RecipeFile;
|
||||
use goose::subprocess::SubprocessExt;
|
||||
use std::env;
|
||||
use std::fs;
|
||||
|
||||
use std::path::Path;
|
||||
use std::path::PathBuf;
|
||||
use std::process::Command;
|
||||
@@ -104,6 +106,7 @@ pub fn ensure_gh_authenticated() -> Result<()> {
|
||||
// Check authentication status
|
||||
let status = Command::new("gh")
|
||||
.args(["auth", "status"])
|
||||
.set_no_window()
|
||||
.status()
|
||||
.map_err(|_| {
|
||||
anyhow::anyhow!("Failed to run `gh auth status`. Make sure you have `gh` installed.")
|
||||
@@ -151,6 +154,7 @@ fn ensure_repo_cloned(recipe_repo_full_name: &str) -> Result<PathBuf> {
|
||||
let status = Command::new("gh")
|
||||
.args(["repo", "clone", recipe_repo_full_name])
|
||||
.current_dir(local_repo_parent_path.clone())
|
||||
.set_no_window()
|
||||
.status()
|
||||
.map_err(|_: std::io::Error| anyhow::anyhow!(error_message.clone()))?;
|
||||
|
||||
@@ -167,6 +171,7 @@ fn fetch_origin(local_repo_path: &Path) -> Result<()> {
|
||||
let status = Command::new("git")
|
||||
.args(["fetch", "origin"])
|
||||
.current_dir(local_repo_path)
|
||||
.set_no_window()
|
||||
.status()
|
||||
.map_err(|_| anyhow::anyhow!(error_message.clone()))?;
|
||||
|
||||
@@ -190,6 +195,7 @@ fn get_folder_from_github(local_repo_path: &Path, recipe_name: &str) -> Result<P
|
||||
.args(["archive", &ref_and_path])
|
||||
.current_dir(local_repo_path)
|
||||
.stdout(Stdio::piped())
|
||||
.set_no_window()
|
||||
.spawn()?;
|
||||
|
||||
let stdout = archive_output
|
||||
@@ -230,6 +236,7 @@ fn discover_github_recipes(repo: &str) -> Result<Vec<RecipeInfo>> {
|
||||
// Get repository contents using GitHub CLI
|
||||
let output = Command::new("gh")
|
||||
.args(["api", &format!("repos/{}/contents", repo)])
|
||||
.set_no_window()
|
||||
.output()
|
||||
.map_err(|e| anyhow!("Failed to fetch repository contents using 'gh api' command (executed when GOOSE_RECIPE_GITHUB_REPO is configured). This requires GitHub CLI (gh) to be installed and authenticated. Error: {}", e))?;
|
||||
|
||||
@@ -269,6 +276,7 @@ fn check_github_directory_for_recipe(repo: &str, dir_name: &str) -> Result<Recip
|
||||
// Check directory contents for recipe files
|
||||
let output = Command::new("gh")
|
||||
.args(["api", &format!("repos/{}/contents/{}", repo, dir_name)])
|
||||
.set_no_window()
|
||||
.output()
|
||||
.map_err(|e| anyhow!("Failed to check directory contents: {}", e))?;
|
||||
|
||||
@@ -306,6 +314,7 @@ fn get_github_recipe_info(repo: &str, dir_name: &str, recipe_filename: &str) ->
|
||||
"api",
|
||||
&format!("repos/{}/contents/{}/{}", repo, dir_name, recipe_filename),
|
||||
])
|
||||
.set_no_window()
|
||||
.output()
|
||||
.map_err(|e| anyhow!("Failed to get recipe file content: {}", e))?;
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@ use goose::conversation::message::{
|
||||
ActionRequiredData, Message, MessageContent, ToolRequest, ToolResponse,
|
||||
};
|
||||
use goose::providers::canonical::maybe_get_canonical_model;
|
||||
#[cfg(target_os = "windows")]
|
||||
use goose::subprocess::SubprocessExt;
|
||||
use goose::utils::safe_truncate;
|
||||
use indicatif::{MultiProgress, ProgressBar, ProgressStyle};
|
||||
use rmcp::model::{CallToolRequestParams, JsonObject, PromptArgument};
|
||||
@@ -179,6 +181,7 @@ pub fn run_status_hook(status: &str) {
|
||||
.stdin(std::process::Stdio::null())
|
||||
.stdout(std::process::Stdio::null())
|
||||
.stderr(std::process::Stdio::null())
|
||||
.set_no_window()
|
||||
.status();
|
||||
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
|
||||
Reference in New Issue
Block a user