fix: Consider `$STARSHIP_CONFIG` in `configure` (#795)
Makes starship configure consider the $STARSHIP_CONFIG variable before falling back to the default of ~/.config/starship.toml.
This commit is contained in:
parent
a8e20ef387
commit
6bafe4cd66
|
@ -40,11 +40,16 @@ fn get_editor_internal(visual: Option<OsString>, editor: Option<OsString>) -> Os
|
|||
}
|
||||
|
||||
fn get_config_path() -> OsString {
|
||||
let config_path = env::var_os("STARSHIP_CONFIG").unwrap_or_else(|| "".into());
|
||||
if config_path.is_empty() {
|
||||
dirs::home_dir()
|
||||
.expect("Couldn't find home directory")
|
||||
.expect("couldn't find home directory")
|
||||
.join(".config/starship.toml")
|
||||
.as_os_str()
|
||||
.to_owned()
|
||||
} else {
|
||||
config_path
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
Loading…
Reference in New Issue