37a896b09e0bfa5e495cd2ce734cf228218297a9
- Author
- Michael Aquilina <michaelaquilina@gmail.com>
- Committer
- GitHub <noreply@github.com>
- Date
Message
Merge pull request #6 from wookayin/fix-unset
Handle properly a case where VIRTUAL_ENV is unset
Diff
1diff --git a/autoswitch_virtualenv.plugin.zsh b/autoswitch_virtualenv.plugin.zsh
2index bb80f3c4502cb8786e0234ea66ec0dbc29bba01e..effa6d695163b61af167bdaaa19dfe8b45cd9108 100644
3--- a/autoswitch_virtualenv.plugin.zsh
4+++ b/autoswitch_virtualenv.plugin.zsh
5@@ -3,7 +3,7 @@ function precmd() {
6 }
7
8 function maybeworkon() {
9- if [ "$1" != "$(basename $VIRTUAL_ENV)" ]; then
10+ if [[ -z "$VIRTUAL_ENV" || "$1" != "$(basename $VIRTUAL_ENV)" ]]; then
11 if [ -z "$AUTOSWITCH_SILENT" ]; then
12 printf "Switching virtualenv: %s " $1
13 fi