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:
parent
4b82839c90
commit
272b7e2b93
5 changed files with 32 additions and 26 deletions
|
@ -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`?
|
||||
})
|
||||
})
|
||||
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue