Skip to content

Commit

Permalink
Update python-venv.nu so we can enter subdirectory without an error (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
WindSoilder committed Aug 14, 2023
1 parent e60d207 commit dd499c9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions modules/virtual_environments/auto-venv/venvs/python-venv.nu
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,19 @@ export def-env auto-venv-on-enter [
$'($virtual_prompt)'
}

# Add current PWD to NU_LIB_DIRS so we can enter sub-directory without an error
let new_lib_dirs = if not $env.PWD in $env.NU_LIB_DIRS {
$env.NU_LIB_DIRS | prepend $env.PWD
} else {
$env.NU_LIB_DIRS
}
# Environment variables that will be batched loaded to the virtual env
let new_env = {
$path_name : $new_path
VIRTUAL_ENV : $virtual_env
PROMPT_COMMAND : $new_prompt
VIRTUAL_PROMPT : $virtual_prompt
NU_LIB_DIRS : $new_lib_dirs
}

# Activate the environment variables
Expand Down

0 comments on commit dd499c9

Please sign in to comment.