Update name to gitlore instead of gitlab-inbox
This commit is contained in:
@@ -159,7 +159,7 @@ pub fn run_migrations_from_dir(conn: &Connection, migrations_dir: &Path) -> Resu
|
||||
}
|
||||
|
||||
/// Verify database pragmas are set correctly.
|
||||
/// Used by gi doctor command.
|
||||
/// Used by lore doctor command.
|
||||
pub fn verify_pragmas(conn: &Connection) -> (bool, Vec<String>) {
|
||||
let mut issues = Vec::new();
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! Custom error types for gitlab-inbox.
|
||||
//! Custom error types for gitlore.
|
||||
//!
|
||||
//! Uses thiserror for ergonomic error definitions with structured error codes.
|
||||
|
||||
@@ -65,10 +65,10 @@ impl ErrorCode {
|
||||
}
|
||||
}
|
||||
|
||||
/// Main error type for gitlab-inbox.
|
||||
/// Main error type for gitlore.
|
||||
#[derive(Error, Debug)]
|
||||
pub enum GiError {
|
||||
#[error("Config file not found at {path}. Run \"gi init\" first.")]
|
||||
#[error("Config file not found at {path}. Run \"lore init\" first.")]
|
||||
ConfigNotFound { path: String },
|
||||
|
||||
#[error("Invalid config: {details}")]
|
||||
@@ -158,18 +158,18 @@ impl GiError {
|
||||
/// Get a suggestion for how to fix this error.
|
||||
pub fn suggestion(&self) -> Option<&'static str> {
|
||||
match self {
|
||||
Self::ConfigNotFound { .. } => Some("Run 'gi init' to create configuration"),
|
||||
Self::ConfigInvalid { .. } => Some("Check config file syntax or run 'gi init' to recreate"),
|
||||
Self::ConfigNotFound { .. } => Some("Run 'lore init' to create configuration"),
|
||||
Self::ConfigInvalid { .. } => Some("Check config file syntax or run 'lore init' to recreate"),
|
||||
Self::GitLabAuthFailed => Some("Verify token has read_api scope and is not expired"),
|
||||
Self::GitLabNotFound { .. } => Some("Check the resource path exists and you have access"),
|
||||
Self::GitLabRateLimited { .. } => Some("Wait and retry, or reduce request frequency"),
|
||||
Self::GitLabNetworkError { .. } => Some("Check network connection and GitLab URL"),
|
||||
Self::DatabaseLocked { .. } => Some("Wait for other sync to complete or use --force"),
|
||||
Self::MigrationFailed { .. } => Some("Check database file permissions or reset with 'gi reset'"),
|
||||
Self::MigrationFailed { .. } => Some("Check database file permissions or reset with 'lore reset'"),
|
||||
Self::TokenNotSet { .. } => Some("Export the token environment variable"),
|
||||
Self::Database(_) => Some("Check database file permissions or reset with 'gi reset'"),
|
||||
Self::Database(_) => Some("Check database file permissions or reset with 'lore reset'"),
|
||||
Self::Http(_) => Some("Check network connection"),
|
||||
Self::NotFound(_) => Some("Verify the entity exists using 'gi list'"),
|
||||
Self::NotFound(_) => Some("Verify the entity exists using 'lore list'"),
|
||||
Self::Ambiguous(_) => Some("Use --project flag to disambiguate"),
|
||||
_ => None,
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user