fpf-cli 1.6.10 → 1.6.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fpf +13 -6
- package/package.json +1 -1
package/fpf
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
set -euo pipefail
|
|
4
4
|
|
|
5
5
|
SCRIPT_NAME="fpf"
|
|
6
|
-
SCRIPT_VERSION="1.6.
|
|
6
|
+
SCRIPT_VERSION="1.6.11"
|
|
7
7
|
TMP_ROOT="${TMPDIR:-/tmp}/fpf"
|
|
8
8
|
SESSION_TMP_ROOT=""
|
|
9
9
|
HELP_FILE=""
|
|
@@ -710,11 +710,16 @@ exact_match_entry() {
|
|
|
710
710
|
printf "%s\t-\n" "${query}"
|
|
711
711
|
fi
|
|
712
712
|
;;
|
|
713
|
-
npm
|
|
713
|
+
npm)
|
|
714
714
|
if command_exists npm && npm view "${query}" name >/dev/null 2>&1; then
|
|
715
715
|
printf "%s\t-\n" "${query}"
|
|
716
716
|
fi
|
|
717
717
|
;;
|
|
718
|
+
bun)
|
|
719
|
+
if bun info "${query}" >/dev/null 2>&1 || (command_exists npm && npm view "${query}" name >/dev/null 2>&1); then
|
|
720
|
+
printf "%s\t-\n" "${query}"
|
|
721
|
+
fi
|
|
722
|
+
;;
|
|
718
723
|
esac
|
|
719
724
|
}
|
|
720
725
|
|
|
@@ -740,7 +745,7 @@ manager_search_entries() {
|
|
|
740
745
|
|
|
741
746
|
if [[ -z "${effective_query}" ]]; then
|
|
742
747
|
case "${manager}" in
|
|
743
|
-
apt|dnf|pacman|zypper|emerge|choco|scoop|snap
|
|
748
|
+
apt|dnf|pacman|zypper|emerge|choco|scoop|snap)
|
|
744
749
|
effective_query="a"
|
|
745
750
|
;;
|
|
746
751
|
brew|npm|bun)
|
|
@@ -894,13 +899,15 @@ manager_search_entries() {
|
|
|
894
899
|
;;
|
|
895
900
|
bun)
|
|
896
901
|
{
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
902
|
+
local bun_search_file
|
|
903
|
+
bun_search_file="$(mktemp "${SESSION_TMP_ROOT}/bun-search.XXXXXX")"
|
|
904
|
+
if bun search "${effective_query}" >"${bun_search_file}" 2>/dev/null; then
|
|
905
|
+
awk 'NR > 1 && NF > 0 { name=$1; $1=""; sub(/^[[:space:]]+/, "", $0); if ($0 == "") $0="-"; print name "\t" $0 }' "${bun_search_file}"
|
|
900
906
|
elif command_exists npm; then
|
|
901
907
|
npm search "${effective_query}" --searchlimit="${npm_search_limit}" --parseable 2>/dev/null |
|
|
902
908
|
awk -F'\t' 'NF >= 2 { print $1 "\t" $2 }'
|
|
903
909
|
fi
|
|
910
|
+
rm -f "${bun_search_file}"
|
|
904
911
|
exact_match_entry "${manager}" "${query}"
|
|
905
912
|
} || true
|
|
906
913
|
;;
|