mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-28 20:39:40 -08:00
parent
1899896c6d
commit
c22d0d67be
|
@ -135,8 +135,7 @@ func (p *Python) pyenvVersion() (string, error) {
|
|||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
// Unset whatever loadContext thinks Venv should be
|
||||
p.Venv = ""
|
||||
// override virtualenv if pyenv set one
|
||||
parts := strings.Split(shortPath, string(filepath.Separator))
|
||||
if len(parts) > 2 && p.canUseVenvName(parts[2]) {
|
||||
p.Venv = parts[2]
|
||||
|
|
|
@ -70,9 +70,9 @@ func TestPythonTemplate(t *testing.T) {
|
|||
Case: "Pyenv virtual env version name",
|
||||
FetchVersion: true,
|
||||
VirtualEnvName: "demo",
|
||||
Expected: "3.8.4",
|
||||
Expected: "demo 3.8.4",
|
||||
PythonPath: "/home/user/.pyenv/shims/python",
|
||||
Template: "{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}",
|
||||
Template: "{{ .Venv }} {{ .Full }}",
|
||||
ResolveSymlink: ResolveSymlink{Path: "/home/user/.pyenv/versions/demo", Err: nil},
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue