Skip to content

Commit

Permalink
Completions (zsh, fish): check for python3 (#1310)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Davis-A and Andrew Davis authored Oct 2, 2024
1 parent 89d3924 commit 8a11aa0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions completions/fastfetch.fish
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions completions/fastfetch.zsh
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#compdef fastfetch

function _fastfetch() {

whence python3 &> /dev/null
if [ $? -ne 0 ]
then
return
fi

local state

local -a opts=("${(f)$(
Expand Down

0 comments on commit 8a11aa0

Please sign in to comment.