Skip to content

Commit

Permalink
fish: py_venv: Allow specifying python to use
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Chancellor <[email protected]>
  • Loading branch information
nathanchance committed Oct 2, 2024
1 parent d1eb8aa commit ce0e591
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fish/functions/py_venv.fish
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ function py_venv -d "Manage Python virtual environment"
switch $arg
case c create e enter exit i in install l ls list r rm remove u up update x
set -a actions $arg
case python*
set python $arg
case '*'
set venv $arg
end
Expand All @@ -15,6 +17,9 @@ function py_venv -d "Manage Python virtual environment"
print_error "no actions specified!"
return 1
end
if not set -q python
set python python3
end
if not set -q venv
if in_venv
set venv (basename $VIRTUAL_ENV)
Expand Down Expand Up @@ -50,7 +55,7 @@ function py_venv -d "Manage Python virtual environment"
for action in $actions
switch $action
case c create
python3 -m venv $venv
$python -m venv $venv

case e enter
if in_venv
Expand Down

0 comments on commit ce0e591

Please sign in to comment.