Completions (zsh, fish): check for python3 (#1310)

Both the zsh and fish completions depend on python3.
When the completitions kick in with those shells where no python3 is
found it throws errors.

Check python3 is installed, otherwise return no completitions to avoid
throwing errors

Co-authored-by: Andrew Davis <adavis@adavis.net>
This commit is contained in:
Andrew Davis 2024-10-02 23:30:19 +10:00 committed by GitHub
parent 89d3924659
commit 8a11aa0f8f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 0 deletions

View File

@ -2,6 +2,11 @@ if not type -q fastfetch
exit
end
command -q python3
if test $status -ne 0
exit
end
complete -c fastfetch -f
function __fastfetch_complete_bool

View File

@ -1,6 +1,13 @@
#compdef fastfetch
function _fastfetch() {
whence python3 &> /dev/null
if [ $? -ne 0 ]
then
return
fi
local state
local -a opts=("${(f)$(