fix: do not try to load old completion with new version

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Carlo Sala 2026-08-03 22:38:49 +02:00 committed by GitHub
commit 3e778c440f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -24,13 +24,14 @@ fi
[[ -n "$_pipenv_fresh_version" ]] && print -r -- "$_pipenv_fresh_version" >| "$_pipenv_version_cache"
} &|
if is-at-least 2026.5.0 "$_pipenv_version" && (( $+commands[register-python-argcomplete] )); then
# argcomplete-based completion
autoload -Uz bashcompinit
bashcompinit
eval "$(register-python-argcomplete pipenv)"
if is-at-least 2026.5.0 "$_pipenv_version"; then
# pipenv >= 2026.5.0: argcomplete-based completion (no legacy fallback)
if (( $+commands[register-python-argcomplete] )); then
autoload -Uz bashcompinit
bashcompinit
eval "$(register-python-argcomplete pipenv)"
fi
else
# legacy Click-based completion via _PIPENV_COMPLETE