fix: implement default config path logic and remove unused variable warning

Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-08-16 13:38:00 -03:00
parent 09ec19fcab
commit 07c579af94
2 changed files with 10 additions and 8 deletions

View File

@@ -80,13 +80,15 @@ impl Settings {
} else if let Ok(env_config) = std::env::var("KEEP_CONFIG") {
PathBuf::from(env_config)
} else {
match Self::default_config_path() {
Ok(path) => path,
Err(e) => {
debug!("CONFIG: Failed to get default config path: {}", e);
PathBuf::from("~/.config/keep/config.yml")
}
}
let default_path = dirs::config_dir()
.map(|mut path| {
path.push("keep");
path.push("config.yml");
path
})
.unwrap_or_else(|| PathBuf::from("~/.config/keep/config.yml"));
debug!("CONFIG: Using default config path: {:?}", default_path);
default_path
};
debug!("CONFIG: Using config path: {:?}", config_path);

View File

@@ -87,7 +87,7 @@ pub fn mode_list(
let mut title_row = row!();
for column in &settings.list_format {
let column_type = ColumnType::from_str(&column.name)
let _column_type = ColumnType::from_str(&column.name)
.map_err(|_| anyhow!("Unknown column {:?}", column.name))?;
title_row.add_cell(Cell::new(&column.label).with_style(Attr::Bold));