From f170938bdc2c5f99550953466fa6c4ac4106023a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batty=C3=A1nyi=20D=C3=A1niel?= <86350313+LoKolbasz@users.noreply.github.com> Date: Tue, 11 Feb 2025 12:41:33 +0100 Subject: [PATCH 1/4] Check for the whole pyenv command instead of just pyenv --- plugins/available/virtualenv.plugin.bash | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/available/virtualenv.plugin.bash b/plugins/available/virtualenv.plugin.bash index 5bc5c651fc..897e974959 100644 --- a/plugins/available/virtualenv.plugin.bash +++ b/plugins/available/virtualenv.plugin.bash @@ -5,11 +5,14 @@ cite about-plugin about-plugin 'virtualenvwrapper and pyenv-virtualenvwrapper helper functions' -if _command_exists pyenv; then +# Check for whole command instead of just pyenv +if [ -n "$(pyenv virtualenvwrapper --help 2> /dev/null)" ]; then pyenv virtualenvwrapper elif _command_exists virtualenvwrapper.sh; then # shellcheck disable=SC1091 source virtualenvwrapper.sh +else + log_debug "${2:-'virtualenvwrapper' was not found}" fi function mkvenv { From 80aeb5d869a112403e4e8fdc65a1137900f4ea53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batty=C3=A1nyi=20D=C3=A1niel?= <86350313+LoKolbasz@users.noreply.github.com> Date: Tue, 11 Feb 2025 12:52:08 +0100 Subject: [PATCH 2/4] Fixed logging call --- plugins/available/virtualenv.plugin.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/available/virtualenv.plugin.bash b/plugins/available/virtualenv.plugin.bash index 897e974959..afc7325ce0 100644 --- a/plugins/available/virtualenv.plugin.bash +++ b/plugins/available/virtualenv.plugin.bash @@ -12,7 +12,7 @@ elif _command_exists virtualenvwrapper.sh; then # shellcheck disable=SC1091 source virtualenvwrapper.sh else - log_debug "${2:-'virtualenvwrapper' was not found}" + _log_debug "${2:-'virtualenvwrapper' was not found}" fi function mkvenv { From 48b607e149b33959b1989bd052496bd0dbdeebe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batty=C3=A1nyi=20D=C3=A1niel?= <86350313+LoKolbasz@users.noreply.github.com> Date: Tue, 11 Feb 2025 12:52:37 +0100 Subject: [PATCH 3/4] Use 'command' call when calling pyenv --- plugins/available/virtualenv.plugin.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/available/virtualenv.plugin.bash b/plugins/available/virtualenv.plugin.bash index afc7325ce0..12dfe05eff 100644 --- a/plugins/available/virtualenv.plugin.bash +++ b/plugins/available/virtualenv.plugin.bash @@ -6,8 +6,8 @@ cite about-plugin about-plugin 'virtualenvwrapper and pyenv-virtualenvwrapper helper functions' # Check for whole command instead of just pyenv -if [ -n "$(pyenv virtualenvwrapper --help 2> /dev/null)" ]; then - pyenv virtualenvwrapper +if [ -n "$(command pyenv virtualenvwrapper --help 2> /dev/null)" ]; then + command pyenv virtualenvwrapper elif _command_exists virtualenvwrapper.sh; then # shellcheck disable=SC1091 source virtualenvwrapper.sh From 51a0978b19c3662e235dd2dc26eea751c54f869c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batty=C3=A1nyi=20D=C3=A1niel?= <86350313+LoKolbasz@users.noreply.github.com> Date: Tue, 11 Feb 2025 14:40:49 +0100 Subject: [PATCH 4/4] Fixed pyenv error Pyenv claimed that it was not configured correctly. Removing the command seems to have fixed it --- plugins/available/virtualenv.plugin.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/available/virtualenv.plugin.bash b/plugins/available/virtualenv.plugin.bash index 12dfe05eff..9f80fbac8f 100644 --- a/plugins/available/virtualenv.plugin.bash +++ b/plugins/available/virtualenv.plugin.bash @@ -7,7 +7,7 @@ about-plugin 'virtualenvwrapper and pyenv-virtualenvwrapper helper functions' # Check for whole command instead of just pyenv if [ -n "$(command pyenv virtualenvwrapper --help 2> /dev/null)" ]; then - command pyenv virtualenvwrapper + pyenv virtualenvwrapper elif _command_exists virtualenvwrapper.sh; then # shellcheck disable=SC1091 source virtualenvwrapper.sh