64b36c5132e0f418a3286cb8cf0d9cb1c9e18e75

Author
Michael Aquilina <michael.aquilina@snyk.io>
Committer
Michael Aquilina <michael.aquilina@snyk.io>
Date

Message

Disable pipenv warnings being shown

Diff

 1diff --git a/autoswitch_virtualenv.plugin.zsh b/autoswitch_virtualenv.plugin.zsh
 2index 807f0796a52abb09d2763b4ad65e0ba9d45eb91c..638bf1cf82e9bcd650bbabcda03e58a9fc52806d 100644
 3--- a/autoswitch_virtualenv.plugin.zsh
 4+++ b/autoswitch_virtualenv.plugin.zsh
 5@@ -83,6 +83,12 @@ function _maybeworkon() {
 6         message="${message//\%py_version/$py_version}"
 7         _autoswitch_message "${message}\n"
 8 
 9+        # If we are using pipenv and activate its virtual environment - turn down its verbosity
10+        # to prevent users seeing " Pipenv found itself running within a virtual environment" warning
11+        if [[ "$venv_type" == "pipenv" && "$PIPENV_VERBOSITY" != -1 ]]; then
12+            export PIPENV_VERBOSITY=-1
13+        fi
14+
15         # Much faster to source the activate file directly rather than use the `workon` command
16         source "$venv_dir/bin/activate"
17     fi