fpf-cli 1.6.12 → 1.6.14
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 +70 -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.14"
|
|
7
7
|
TMP_ROOT="${TMPDIR:-/tmp}/fpf"
|
|
8
8
|
SESSION_TMP_ROOT=""
|
|
9
9
|
HELP_FILE=""
|
|
@@ -1114,16 +1114,79 @@ manager_installed_entries() {
|
|
|
1114
1114
|
;;
|
|
1115
1115
|
npm)
|
|
1116
1116
|
npm ls -g --depth=0 --parseable 2>/dev/null |
|
|
1117
|
-
awk
|
|
1117
|
+
awk '
|
|
1118
|
+
NR > 1 {
|
|
1119
|
+
line = $0
|
|
1120
|
+
gsub(/\r/, "", line)
|
|
1121
|
+
gsub(/\\/, "/", line)
|
|
1122
|
+
|
|
1123
|
+
n = split(line, parts, "/")
|
|
1124
|
+
if (n < 1) next
|
|
1125
|
+
|
|
1126
|
+
pkg = parts[n]
|
|
1127
|
+
if (pkg == "" && n > 1) pkg = parts[n - 1]
|
|
1128
|
+
if (pkg == "") next
|
|
1129
|
+
|
|
1130
|
+
if (n >= 2 && parts[n - 1] ~ /^@/) {
|
|
1131
|
+
pkg = parts[n - 1] "/" pkg
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
print pkg "\tglobal"
|
|
1135
|
+
}
|
|
1136
|
+
'
|
|
1118
1137
|
;;
|
|
1119
1138
|
bun)
|
|
1120
1139
|
{
|
|
1121
1140
|
if bun pm ls --global >/dev/null 2>&1; then
|
|
1122
1141
|
bun pm ls --global 2>/dev/null |
|
|
1123
|
-
awk '
|
|
1142
|
+
awk '
|
|
1143
|
+
NR > 1 {
|
|
1144
|
+
line = $0
|
|
1145
|
+
gsub(/\r/, "", line)
|
|
1146
|
+
sub(/^[[:space:]]*[^[:alnum:]@]*/, "", line)
|
|
1147
|
+
sub(/^[[:space:]]+/, "", line)
|
|
1148
|
+
sub(/[[:space:]]+$/, "", line)
|
|
1149
|
+
|
|
1150
|
+
if (line == "") next
|
|
1151
|
+
if (line ~ /[[:space:]]node_modules([[:space:]]|$)/) next
|
|
1152
|
+
|
|
1153
|
+
split(line, fields, /[[:space:]]+/)
|
|
1154
|
+
pkg = fields[1]
|
|
1155
|
+
if (pkg == "") next
|
|
1156
|
+
|
|
1157
|
+
pkg_copy = pkg
|
|
1158
|
+
at_count = gsub(/@/, "@", pkg_copy)
|
|
1159
|
+
if ((substr(pkg, 1, 1) == "@" && at_count >= 2) || (substr(pkg, 1, 1) != "@" && at_count >= 1)) {
|
|
1160
|
+
sub(/@[^@[:space:]]*$/, "", pkg)
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
if (pkg != "") {
|
|
1164
|
+
print pkg "\tglobal"
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
'
|
|
1124
1168
|
elif command_exists npm; then
|
|
1125
1169
|
npm ls -g --depth=0 --parseable 2>/dev/null |
|
|
1126
|
-
awk
|
|
1170
|
+
awk '
|
|
1171
|
+
NR > 1 {
|
|
1172
|
+
line = $0
|
|
1173
|
+
gsub(/\r/, "", line)
|
|
1174
|
+
gsub(/\\/, "/", line)
|
|
1175
|
+
|
|
1176
|
+
n = split(line, parts, "/")
|
|
1177
|
+
if (n < 1) next
|
|
1178
|
+
|
|
1179
|
+
pkg = parts[n]
|
|
1180
|
+
if (pkg == "" && n > 1) pkg = parts[n - 1]
|
|
1181
|
+
if (pkg == "") next
|
|
1182
|
+
|
|
1183
|
+
if (n >= 2 && parts[n - 1] ~ /^@/) {
|
|
1184
|
+
pkg = parts[n - 1] "/" pkg
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
print pkg "\tglobal"
|
|
1188
|
+
}
|
|
1189
|
+
'
|
|
1127
1190
|
fi
|
|
1128
1191
|
} || true
|
|
1129
1192
|
;;
|
|
@@ -1198,7 +1261,7 @@ collect_search_display_rows() {
|
|
|
1198
1261
|
local output_file="$2"
|
|
1199
1262
|
shift 2
|
|
1200
1263
|
local managers=("$@")
|
|
1201
|
-
local query_limit="${FPF_QUERY_RESULT_LIMIT:-
|
|
1264
|
+
local query_limit="${FPF_QUERY_RESULT_LIMIT:-0}"
|
|
1202
1265
|
|
|
1203
1266
|
: >"${output_file}"
|
|
1204
1267
|
|
|
@@ -1531,7 +1594,8 @@ run_fuzzy_selector() {
|
|
|
1531
1594
|
--bind=ctrl-k:preview:"cat ${KBINDS_FILE}" \
|
|
1532
1595
|
--bind=ctrl-h:preview:"cat ${HELP_FILE}" \
|
|
1533
1596
|
--bind='ctrl-/:change-preview-window(hidden|)' \
|
|
1534
|
-
--bind=ctrl-n:next-selected,ctrl-b:prev-selected
|
|
1597
|
+
--bind=ctrl-n:next-selected,ctrl-b:prev-selected \
|
|
1598
|
+
--bind='focus:transform-preview-label:echo [{1}] {2}')
|
|
1535
1599
|
|
|
1536
1600
|
if [[ -n "${reload_cmd}" ]]; then
|
|
1537
1601
|
fzf_args+=(--bind="change:reload:${reload_cmd}")
|