Skip to content

Commit

Permalink
fix: don't use $venv_path if we don't have *Pipenv* or *Poetry* ins…
Browse files Browse the repository at this point in the history
…talled
  • Loading branch information
stevenxxiu committed Sep 30, 2021
1 parent 74218c1 commit 64fad6a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions autoswitch_virtualenv.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,12 @@ function check_venv()
printf "Reason: Found a $AUTOSWITCH_FILE file with weak permission settings ($file_permissions).\n"
printf "Run the following command to fix this: ${PURPLE}\"chmod 600 $venv_path\"${NORMAL}\n"
else
if [[ "$venv_path" == *"/Pipfile" ]] && type "pipenv" > /dev/null; then
if _activate_pipenv; then
if [[ "$venv_path" == *"/Pipfile" ]]; then
if type "pipenv" > /dev/null && _activate_pipenv; then
return
fi
elif [[ "$venv_path" == *"/poetry.lock" ]] && type "poetry" > /dev/null; then
if _activate_poetry; then
elif [[ "$venv_path" == *"/poetry.lock" ]]; then
if type "poetry" > /dev/null && _activate_poetry; then
return
fi
else
Expand Down

0 comments on commit 64fad6a

Please sign in to comment.