1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-02 23:27:45 +00:00

auto-venv for python: update to be compatible with nu 0.80 (#513)

* auto-venv python passes syntax checks

* update readme.md

* everything works!
This commit is contained in:
Hörmet Yiltiz 2023-05-26 13:31:10 -05:00 committed by GitHub
parent 4b82839c90
commit 272b7e2b93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 32 additions and 26 deletions

View file

@ -28,7 +28,7 @@ export def has-entered-venv [
after: path,
] {
let target = path find-sub $after $env.AUTO_VENV_TRIGGER
let target = (path find-sub $after $env.AUTO_VENV_TRIGGER)
(if ($target | is-empty) {
false
@ -47,13 +47,17 @@ export def has-swapped-venv [
false
}
else {
let target = path find-sub $after $env.AUTO_VENV_TRIGGER
let target = (path find-sub $after $env.AUTO_VENV_TRIGGER)
(if ($target | is-empty) {
false
}
else {
$env.VIRTUAL_ENV != $target
(if ('VIRTUAL_ENV' in $env) {
$env.VIRTUAL_ENV != $target
} else {
false # should it default to `false`?
})
})
})