use std::path::PathBuf;
#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
pub enum ConfigError {
#[error("Could not determine a config directory")]
ConfigDirNotFound,
#[error("Could not determine the home directory")]
NoHomeDir,
}
#[derive(Debug, Clone, PartialEq, Eq, derive_more::Display)]
pub enum ConfigWarning {
#[display(
"$env.XDG_CONFIG_HOME ({xdg}) is set to a non-absolute path, \
using default config directory instead: {}",
resolved.display(),
)]
XdgConfigIgnored { xdg: String, resolved: PathBuf },
#[display(
"WARNING: XDG_CONFIG_HOME has been set but {} is empty.\n\
Nushell will not move your configuration files from {}",
new.display(),
old.display(),
)]
OldConfigDirHasFiles { old: PathBuf, new: PathBuf },
}