mirror of
https://github.com/Llewellynvdm/starship.git
synced 2024-12-01 01:04:00 +00:00
feat(python): Show value of PYENV_VERSION when present (#3144)
* 2872: Show value of PYENV_VERSION when present * 2872: Run cargo fmt
This commit is contained in:
parent
9c68d181e4
commit
8d80d2ef06
@ -76,12 +76,19 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn get_pyenv_version(context: &Context) -> Option<String> {
|
fn get_pyenv_version(context: &Context) -> Option<String> {
|
||||||
let version_name = context
|
let mut version_name = context.get_env("PYENV_VERSION");
|
||||||
.exec_cmd("pyenv", &["version-name"])?
|
|
||||||
.stdout
|
if version_name.is_none() {
|
||||||
.trim()
|
version_name = Some(
|
||||||
.to_string();
|
context
|
||||||
Some(version_name)
|
.exec_cmd("pyenv", &["version-name"])?
|
||||||
|
.stdout
|
||||||
|
.trim()
|
||||||
|
.to_string(),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
version_name
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_python_version(context: &Context, config: &PythonConfig) -> Option<String> {
|
fn get_python_version(context: &Context, config: &PythonConfig) -> Option<String> {
|
||||||
|
Loading…
Reference in New Issue
Block a user