9050ed34d1f58e09012ed88db8bed1a0d7e74fb1

Author
R Max Espinoza <me@rmax.io>
Committer
GitHub <noreply@github.com>
Date

Message

pipenv: fix error when Pipfile is not a file (#8931)

Diff

 1diff --git a/plugins/pipenv/pipenv.plugin.zsh b/plugins/pipenv/pipenv.plugin.zsh
 2index ec41c3e02960fad0c9b6428a22219849e29bee48..e7a9e6b3c6bbdf5ec6aae74a4521110e3421d79e 100644
 3--- a/plugins/pipenv/pipenv.plugin.zsh
 4+++ b/plugins/pipenv/pipenv.plugin.zsh
 5@@ -7,7 +7,7 @@ compdef _pipenv pipenv
 6 # Automatic pipenv shell activation/deactivation
 7 _togglePipenvShell() {
 8   # deactivate shell if Pipfile doesn't exist and not in a subdir
 9-  if [[ ! -a "$PWD/Pipfile" ]]; then
10+  if [[ ! -f "$PWD/Pipfile" ]]; then
11     if [[ "$PIPENV_ACTIVE" == 1 ]]; then
12       if [[ "$PWD" != "$pipfile_dir"* ]]; then
13         exit
14@@ -17,7 +17,7 @@ _togglePipenvShell() {
15 
16   # activate the shell if Pipfile exists
17   if [[ "$PIPENV_ACTIVE" != 1 ]]; then
18-    if [[ -a "$PWD/Pipfile" ]]; then
19+    if [[ -f "$PWD/Pipfile" ]]; then
20       export pipfile_dir="$PWD"
21       pipenv shell
22     fi