Allow activating venv in current folder.
This commit is contained in:
parent
bb2f454add
commit
b3b446599a
@ -23,7 +23,7 @@ Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward
|
|||||||
Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
|
Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
|
||||||
Set-PSReadlineOption -BellStyle None
|
Set-PSReadlineOption -BellStyle None
|
||||||
|
|
||||||
# kube
|
# kube / helm
|
||||||
if (Get-Command kubectl -ErrorAction SilentlyContinue) {
|
if (Get-Command kubectl -ErrorAction SilentlyContinue) {
|
||||||
kubectl completion powershell | Out-String | Invoke-Expression
|
kubectl completion powershell | Out-String | Invoke-Expression
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,9 @@ function venv {
|
|||||||
if (Test-Path "$env:WORKON_HOME/$venv/Scripts/activate.ps1") {
|
if (Test-Path "$env:WORKON_HOME/$venv/Scripts/activate.ps1") {
|
||||||
& "$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")) {
|
elseif ((!$venv -Or !$venv.Trim()) -And (Test-Path "venv/Scripts/activate.ps1")) {
|
||||||
& "venv/Scripts/activate.ps1"
|
& "venv/Scripts/activate.ps1"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user