Added cmd to validate bundled extensions json (#7217)
This commit is contained in:
@@ -7,7 +7,10 @@ mod routes;
|
||||
mod state;
|
||||
mod tunnel;
|
||||
|
||||
use std::path::PathBuf;
|
||||
|
||||
use clap::{Parser, Subcommand};
|
||||
use goose::agents::validate_extensions;
|
||||
use goose::config::paths::Paths;
|
||||
use goose_mcp::{
|
||||
mcp_server_runner::{serve, McpCommand},
|
||||
@@ -31,6 +34,12 @@ enum Commands {
|
||||
#[arg(value_parser = clap::value_parser!(McpCommand))]
|
||||
server: McpCommand,
|
||||
},
|
||||
/// Validate a bundled-extensions JSON file
|
||||
#[command(name = "validate-extensions")]
|
||||
ValidateExtensions {
|
||||
/// Path to the bundled-extensions JSON file
|
||||
path: PathBuf,
|
||||
},
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
@@ -59,6 +68,15 @@ async fn main() -> anyhow::Result<()> {
|
||||
}
|
||||
}
|
||||
}
|
||||
Commands::ValidateExtensions { path } => {
|
||||
match validate_extensions::validate_bundled_extensions(&path) {
|
||||
Ok(msg) => println!("{msg}"),
|
||||
Err(e) => {
|
||||
eprintln!("{e}");
|
||||
std::process::exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user