mirror of
https://github.com/starship/starship.git
synced 2024-11-24 17:23:49 +01:00
fix(direnv): move symbol
& rc_path
into map
resolves: https://github.com/starship/starship/pull/6389#issuecomment-2480559116
This commit is contained in:
parent
1121a93eb5
commit
f7a083ee19
@ -40,15 +40,6 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
|
||||
let parsed = StringFormatter::new(config.format).and_then(|formatter| {
|
||||
formatter
|
||||
.map_meta(|variable, _| match variable {
|
||||
"symbol" => Some(config.symbol),
|
||||
"rc_path" => match state.rc_path.to_str() {
|
||||
None => {
|
||||
log::warn!("direnv rc path has non UTF-8 characters");
|
||||
|
||||
None
|
||||
}
|
||||
ret => ret,
|
||||
},
|
||||
"allowed" => Some(match state.allowed {
|
||||
AllowStatus::Allowed => config.allowed_msg,
|
||||
AllowStatus::NotAllowed => config.not_allowed_msg,
|
||||
@ -64,6 +55,11 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
|
||||
"style" => Some(Ok(config.style)),
|
||||
_ => None,
|
||||
})
|
||||
.map(|variable| match variable {
|
||||
"symbol" => Some(Ok(Cow::from(config.symbol))),
|
||||
"rc_path" => Some(Ok(state.rc_path.to_string_lossy())),
|
||||
_ => None,
|
||||
})
|
||||
.parse(None, Some(context))
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user