f56b678888c0ad4ac71458680d75d88b442cf09b

Author
Marc Cornellà <marc.cornella@live.com>
Committer
GitHub <noreply@github.com>
Date

Message

fzf: check for dpkg before checking for fzf in debian

Fixes #8253
Co-authored-by: Mariusz B <mb@binary-offensive.com>

Diff

 1diff --git a/plugins/fzf/fzf.plugin.zsh b/plugins/fzf/fzf.plugin.zsh
 2index 646148297735efac1e3c68275300aec30682d655..f701fdf3252e7dd8e3a7f8f78313f4c3f3aad313 100644
 3--- a/plugins/fzf/fzf.plugin.zsh
 4+++ b/plugins/fzf/fzf.plugin.zsh
 5@@ -1,9 +1,9 @@
 6 function setup_using_base_dir() {
 7-	# Declare all variables local not no mess with outside env in any way
 8-	local fzf_base
 9-	local fzf_shell
10-	local fzfdirs
11-	local dir
12+    # Declare all variables local not no mess with outside env in any way
13+    local fzf_base
14+    local fzf_shell
15+    local fzfdirs
16+    local dir
17 
18     test -d "${FZF_BASE}" && fzf_base="${FZF_BASE}"
19 
20@@ -58,7 +58,7 @@ function setup_using_base_dir() {
21 
22 
23 function setup_using_debian_package() {
24-    dpkg -s fzf &> /dev/null
25+    (( $+command[dpkg] )) && dpkg -s fzf &> /dev/null
26     if (( $? )); then
27         # Either not a debian based distro, or no fzf installed. In any case skip ahead
28         return 1