Update name to gitlore instead of gitlab-inbox

This commit is contained in:
teernisse
2026-01-28 15:49:10 -05:00
parent 9a6357c353
commit 55b895a2eb
31 changed files with 1046 additions and 373 deletions

View File

@@ -6,9 +6,9 @@ use std::path::PathBuf;
///
/// Resolution order:
/// 1. CLI flag override (if provided)
/// 2. GI_CONFIG_PATH environment variable
/// 3. XDG default (~/.config/gi/config.json)
/// 4. Local fallback (./gi.config.json) if exists
/// 2. LORE_CONFIG_PATH environment variable
/// 3. XDG default (~/.config/lore/config.json)
/// 4. Local fallback (./lore.config.json) if exists
/// 5. Returns XDG default even if not exists
pub fn get_config_path(cli_override: Option<&str>) -> PathBuf {
// 1. CLI flag override
@@ -17,18 +17,18 @@ pub fn get_config_path(cli_override: Option<&str>) -> PathBuf {
}
// 2. Environment variable
if let Ok(path) = std::env::var("GI_CONFIG_PATH") {
if let Ok(path) = std::env::var("LORE_CONFIG_PATH") {
return PathBuf::from(path);
}
// 3. XDG default
let xdg_path = get_xdg_config_dir().join("gi").join("config.json");
let xdg_path = get_xdg_config_dir().join("lore").join("config.json");
if xdg_path.exists() {
return xdg_path;
}
// 4. Local fallback (for development)
let local_path = PathBuf::from("gi.config.json");
let local_path = PathBuf::from("lore.config.json");
if local_path.exists() {
return local_path;
}
@@ -38,9 +38,9 @@ pub fn get_config_path(cli_override: Option<&str>) -> PathBuf {
}
/// Get the data directory path.
/// Uses XDG_DATA_HOME or defaults to ~/.local/share/gi
/// Uses XDG_DATA_HOME or defaults to ~/.local/share/lore
pub fn get_data_dir() -> PathBuf {
get_xdg_data_dir().join("gi")
get_xdg_data_dir().join("lore")
}
/// Get the database file path.
@@ -49,7 +49,7 @@ pub fn get_db_path(config_override: Option<&str>) -> PathBuf {
if let Some(path) = config_override {
return PathBuf::from(path);
}
get_data_dir().join("gi.db")
get_data_dir().join("lore.db")
}
/// Get the backup directory path.