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:
@@ -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);
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user