MCPcopy Create free account
hub / github.com/aws/amazon-q-developer-cli / ensure_config_file

Function ensure_config_file

crates/chat-cli/src/cli/mcp.rs:497–507  ·  view source on GitHub ↗
(os: &Os, path: &PathBuf, output: &mut impl Write)

Source from the content-addressed store, hash-verified

495}
496
497async fn ensure_config_file(os: &Os, path: &PathBuf, output: &mut impl Write) -> Result<McpServerConfig> {
498 if !os.fs.exists(path) {
499 if let Some(parent) = path.parent() {
500 os.fs.create_dir_all(parent).await?;
501 }
502 McpServerConfig::default().save_to_file(os, path).await?;
503 writeln!(output, "\n📁 Created MCP config in '{}'", path.display())?;
504 }
505
506 load_cfg(os, path).await
507}
508
509fn parse_env_vars(arg: &str) -> Result<HashMap<String, String>> {
510 let mut vars = HashMap::new();

Callers 2

executeMethod · 0.85

Calls 4

load_cfgFunction · 0.85
create_dir_allMethod · 0.80
existsMethod · 0.45
save_to_fileMethod · 0.45

Tested by

no test coverage detected