mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-04-23 17:18:40 +02:00
feat(config): recognize komorebi_config_home for asc path
This commit ensures that the KOMOREBI_CONFIG_HOME environment variable is recognized by the komorebic check command and the static config loader when used to specify the location of the applications.yaml file. resolve #660
This commit is contained in:
@@ -319,6 +319,16 @@ pub fn resolve_home_path<P: AsRef<Path>>(path: P) -> Result<PathBuf> {
|
||||
resolved = true;
|
||||
}
|
||||
|
||||
std::path::Component::Normal(c) if (c == "$Env:KOMOREBI_CONFIG_HOME") && !resolved => {
|
||||
let komorebi_config_home =
|
||||
PathBuf::from(std::env::var("KOMOREBI_CONFIG_HOME").ok().ok_or_else(|| {
|
||||
anyhow!("there is no KOMOREBI_CONFIG_HOME environment variable set")
|
||||
})?);
|
||||
|
||||
resolved_path.extend(komorebi_config_home.components());
|
||||
resolved = true;
|
||||
}
|
||||
|
||||
_ => resolved_path.push(c),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user