Fix order of if/elseif in posh-venv.

This commit is contained in:
Mikaël Capelle 2023-07-24 20:03:03 +02:00
parent cb4291d6d8
commit 6a9c4bb7e2

View File

@ -36,12 +36,12 @@ function venv {
if (Test-Path "$env:WORKON_HOME/$venv/Scripts/activate.ps1") {
& "$env:WORKON_HOME/$venv/Scripts/activate.ps1"
}
elseif (Test-Path (Join-Path $PWD $venv)) {
& "$venv/Scripts/activate.ps1"
}
elseif ((!$venv -Or !$venv.Trim()) -And (Test-Path "venv/Scripts/activate.ps1")) {
& "venv/Scripts/activate.ps1"
}
elseif (Test-Path (Join-Path $PWD $venv)) {
& "$venv/Scripts/activate.ps1"
}
else {
Write-Error "Environment '${venv}' does not exists."
}