refactor: generated config.yaml (#927)

pull/928/head
sigoden 2 days ago committed by GitHub
parent 98cc9879c7
commit 0673dca816
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -2104,6 +2104,9 @@ fn create_config_file(config_path: &Path) -> Result<()> {
config[CLIENTS_FIELD] = clients_config; config[CLIENTS_FIELD] = clients_config;
let config_data = serde_yaml::to_string(&config).with_context(|| "Failed to create config")?; let config_data = serde_yaml::to_string(&config).with_context(|| "Failed to create config")?;
let config_data = format!(
"# see https://github.com/sigoden/aichat/blob/main/config.example.yaml\n\n{config_data}"
);
ensure_parent_exists(config_path)?; ensure_parent_exists(config_path)?;
std::fs::write(config_path, config_data).with_context(|| "Failed to write to config file")?; std::fs::write(config_path, config_data).with_context(|| "Failed to write to config file")?;

Loading…
Cancel
Save