Skip to content

Commit

Permalink
If I try to create a venv in my home dir, switch to a temp dir instead
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwlchan committed Oct 2, 2024
1 parent 55c3e97 commit c9e6b35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fish_functions/venv.fish
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ function venv --description "Create and activate a new virtual environment"

# I don't want venvs in my home directory; block it if I try
if test "$PWD" = "$HOME"
echo "You can't create a venv in your home directory!" >&2
return 1
echo "You can't create a venv in your home directory; switching to temporary directory" >&2
cd $(mktemp -d)
end

echo "Creating virtual environment in "(pwd)"/.venv"
Expand Down

0 comments on commit c9e6b35

Please sign in to comment.