fpf-cli 1.6.48 → 1.6.49
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 +60 -30
- package/lib/fpf/manager-actions.sh +5 -0
- 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.49"
|
|
7
7
|
TMP_ROOT="${TMPDIR:-/tmp}/fpf"
|
|
8
8
|
SESSION_TMP_ROOT=""
|
|
9
9
|
HELP_FILE=""
|
|
@@ -369,6 +369,16 @@ command_exists() {
|
|
|
369
369
|
command -v "$1" >/dev/null 2>&1
|
|
370
370
|
}
|
|
371
371
|
|
|
372
|
+
invocation_script_path() {
|
|
373
|
+
local script_path="${FPF_SELF_PATH:-${BASH_SOURCE[0]}}"
|
|
374
|
+
|
|
375
|
+
if [[ "${script_path}" != /* ]]; then
|
|
376
|
+
script_path="$(pwd)/${script_path}"
|
|
377
|
+
fi
|
|
378
|
+
|
|
379
|
+
printf "%s" "${script_path}"
|
|
380
|
+
}
|
|
381
|
+
|
|
372
382
|
resolve_script_dir() {
|
|
373
383
|
local script_path="${BASH_SOURCE[0]}"
|
|
374
384
|
local script_dir=""
|
|
@@ -1035,10 +1045,6 @@ start_bun_refresh_worker_async() {
|
|
|
1035
1045
|
local manager_override="$8"
|
|
1036
1046
|
local script_path="${BASH_SOURCE[0]}"
|
|
1037
1047
|
|
|
1038
|
-
if [[ "${script_path}" != /* ]]; then
|
|
1039
|
-
script_path="$(pwd)/${script_path}"
|
|
1040
|
-
fi
|
|
1041
|
-
|
|
1042
1048
|
FPF_BUN_REFRESH_FLAGS="${flags}" \
|
|
1043
1049
|
FPF_BUN_REFRESH_KEY="${key}" \
|
|
1044
1050
|
FPF_BUN_REFRESH_FINGERPRINT="${fingerprint}" \
|
|
@@ -2295,6 +2301,11 @@ rank_display_rows_by_query() {
|
|
|
2295
2301
|
local has_exact=0
|
|
2296
2302
|
local candidate
|
|
2297
2303
|
|
|
2304
|
+
if [[ "${FPF_USE_GO_DISPLAY_PIPELINE:-0}" == "1" && -n "${FPF_SELF_PATH:-}" && -x "${FPF_SELF_PATH}" ]]; then
|
|
2305
|
+
"${FPF_SELF_PATH}" --go-rank-display --go-query "${query}" --go-input "${input_file}"
|
|
2306
|
+
return $?
|
|
2307
|
+
fi
|
|
2308
|
+
|
|
2298
2309
|
[[ -n "${query}" ]] || return 0
|
|
2299
2310
|
|
|
2300
2311
|
while IFS= read -r candidate; do
|
|
@@ -2523,6 +2534,35 @@ manager_search_entries_uncached() {
|
|
|
2523
2534
|
esac
|
|
2524
2535
|
fi
|
|
2525
2536
|
|
|
2537
|
+
if [[ "${FPF_USE_GO_SEARCH_ENTRIES:-0}" == "1" && -n "${FPF_SELF_PATH:-}" && -x "${FPF_SELF_PATH}" ]]; then
|
|
2538
|
+
case "${manager}" in
|
|
2539
|
+
apt|brew)
|
|
2540
|
+
;;
|
|
2541
|
+
flatpak)
|
|
2542
|
+
if [[ -z "${query}" ]]; then
|
|
2543
|
+
:
|
|
2544
|
+
else
|
|
2545
|
+
"${FPF_SELF_PATH}" \
|
|
2546
|
+
--go-search-entries \
|
|
2547
|
+
--go-manager "${manager}" \
|
|
2548
|
+
--go-query "${effective_query}" \
|
|
2549
|
+
--go-limit "${effective_limit}" \
|
|
2550
|
+
--go-npm-search-limit "${npm_search_limit}"
|
|
2551
|
+
return 0
|
|
2552
|
+
fi
|
|
2553
|
+
;;
|
|
2554
|
+
*)
|
|
2555
|
+
"${FPF_SELF_PATH}" \
|
|
2556
|
+
--go-search-entries \
|
|
2557
|
+
--go-manager "${manager}" \
|
|
2558
|
+
--go-query "${effective_query}" \
|
|
2559
|
+
--go-limit "${effective_limit}" \
|
|
2560
|
+
--go-npm-search-limit "${npm_search_limit}"
|
|
2561
|
+
return 0
|
|
2562
|
+
;;
|
|
2563
|
+
esac
|
|
2564
|
+
fi
|
|
2565
|
+
|
|
2526
2566
|
case "${manager}" in
|
|
2527
2567
|
apt)
|
|
2528
2568
|
if search_entries_from_catalog_cache "${manager}" "${effective_query}"; then
|
|
@@ -2799,6 +2839,11 @@ manager_search_entries() {
|
|
|
2799
2839
|
manager_installed_entries() {
|
|
2800
2840
|
local manager="$1"
|
|
2801
2841
|
|
|
2842
|
+
if [[ "${FPF_USE_GO_INSTALLED_ENTRIES:-0}" == "1" && -n "${FPF_SELF_PATH:-}" && -x "${FPF_SELF_PATH}" ]]; then
|
|
2843
|
+
"${FPF_SELF_PATH}" --go-installed-entries --go-manager "${manager}"
|
|
2844
|
+
return $?
|
|
2845
|
+
fi
|
|
2846
|
+
|
|
2802
2847
|
case "${manager}" in
|
|
2803
2848
|
apt)
|
|
2804
2849
|
dpkg-query -W -f='${binary:Package}\t${Version}\n' 2>/dev/null
|
|
@@ -3184,6 +3229,11 @@ merge_search_display_rows() {
|
|
|
3184
3229
|
local source_file="$1"
|
|
3185
3230
|
local output_file="$2"
|
|
3186
3231
|
|
|
3232
|
+
if [[ "${FPF_USE_GO_DISPLAY_PIPELINE:-0}" == "1" && -n "${FPF_SELF_PATH:-}" && -x "${FPF_SELF_PATH}" ]]; then
|
|
3233
|
+
"${FPF_SELF_PATH}" --go-merge-display --go-source "${source_file}" --go-output "${output_file}"
|
|
3234
|
+
return $?
|
|
3235
|
+
fi
|
|
3236
|
+
|
|
3187
3237
|
if [[ ! -s "${source_file}" ]]; then
|
|
3188
3238
|
: >"${output_file}"
|
|
3189
3239
|
return
|
|
@@ -3344,15 +3394,11 @@ build_dynamic_reload_command() {
|
|
|
3344
3394
|
local manager_override="$1"
|
|
3345
3395
|
local fallback_file="$2"
|
|
3346
3396
|
local manager_list_csv="${3:-}"
|
|
3347
|
-
local script_path="$
|
|
3397
|
+
local script_path="$(invocation_script_path)"
|
|
3348
3398
|
local bypass_query_cache="1"
|
|
3349
3399
|
|
|
3350
3400
|
bypass_query_cache="$(dynamic_reload_query_cache_bypass_value)"
|
|
3351
3401
|
|
|
3352
|
-
if [[ "${script_path}" != /* ]]; then
|
|
3353
|
-
script_path="$(pwd)/${script_path}"
|
|
3354
|
-
fi
|
|
3355
|
-
|
|
3356
3402
|
printf 'FPF_SKIP_INSTALLED_MARKERS=1 FPF_BYPASS_QUERY_CACHE=%s FPF_IPC_MANAGER_OVERRIDE=%q FPF_IPC_MANAGER_LIST=%q FPF_IPC_FALLBACK_FILE=%q %q --dynamic-reload -- "{q}"' "${bypass_query_cache}" "${manager_override}" "${manager_list_csv}" "${fallback_file}" "${script_path}"
|
|
3357
3403
|
}
|
|
3358
3404
|
|
|
@@ -3361,15 +3407,11 @@ build_dynamic_reload_command_for_query() {
|
|
|
3361
3407
|
local fallback_file="$2"
|
|
3362
3408
|
local manager_list_csv="$3"
|
|
3363
3409
|
local query_value="$4"
|
|
3364
|
-
local script_path="$
|
|
3410
|
+
local script_path="$(invocation_script_path)"
|
|
3365
3411
|
local bypass_query_cache="1"
|
|
3366
3412
|
|
|
3367
3413
|
bypass_query_cache="$(dynamic_reload_query_cache_bypass_value)"
|
|
3368
3414
|
|
|
3369
|
-
if [[ "${script_path}" != /* ]]; then
|
|
3370
|
-
script_path="$(pwd)/${script_path}"
|
|
3371
|
-
fi
|
|
3372
|
-
|
|
3373
3415
|
printf 'FPF_SKIP_INSTALLED_MARKERS=1 FPF_BYPASS_QUERY_CACHE=%s FPF_IPC_MANAGER_OVERRIDE=%q FPF_IPC_MANAGER_LIST=%q FPF_IPC_FALLBACK_FILE=%q %q --dynamic-reload -- %q' "${bypass_query_cache}" "${manager_override}" "${manager_list_csv}" "${fallback_file}" "${script_path}" "${query_value}"
|
|
3374
3416
|
}
|
|
3375
3417
|
|
|
@@ -3377,11 +3419,7 @@ build_dynamic_reload_ipc_command() {
|
|
|
3377
3419
|
local manager_override="$1"
|
|
3378
3420
|
local fallback_file="$2"
|
|
3379
3421
|
local manager_list_csv="${3:-}"
|
|
3380
|
-
local script_path="$
|
|
3381
|
-
|
|
3382
|
-
if [[ "${script_path}" != /* ]]; then
|
|
3383
|
-
script_path="$(pwd)/${script_path}"
|
|
3384
|
-
fi
|
|
3422
|
+
local script_path="$(invocation_script_path)"
|
|
3385
3423
|
|
|
3386
3424
|
printf 'FPF_IPC_MANAGER_OVERRIDE=%q FPF_IPC_MANAGER_LIST=%q FPF_IPC_FALLBACK_FILE=%q %q --ipc-reload -- "{q}"' "${manager_override}" "${manager_list_csv}" "${fallback_file}" "${script_path}"
|
|
3387
3425
|
}
|
|
@@ -3390,11 +3428,7 @@ build_dynamic_query_notify_ipc_command() {
|
|
|
3390
3428
|
local manager_override="$1"
|
|
3391
3429
|
local fallback_file="$2"
|
|
3392
3430
|
local manager_list_csv="${3:-}"
|
|
3393
|
-
local script_path="$
|
|
3394
|
-
|
|
3395
|
-
if [[ "${script_path}" != /* ]]; then
|
|
3396
|
-
script_path="$(pwd)/${script_path}"
|
|
3397
|
-
fi
|
|
3431
|
+
local script_path="$(invocation_script_path)"
|
|
3398
3432
|
|
|
3399
3433
|
printf 'FPF_IPC_MANAGER_OVERRIDE=%q FPF_IPC_MANAGER_LIST=%q FPF_IPC_FALLBACK_FILE=%q %q --ipc-query-notify -- "{q}"' "${manager_override}" "${manager_list_csv}" "${fallback_file}" "${script_path}"
|
|
3400
3434
|
}
|
|
@@ -3716,17 +3750,13 @@ run_fuzzy_selector() {
|
|
|
3716
3750
|
local header_line="$3"
|
|
3717
3751
|
local reload_cmd="${4:-}"
|
|
3718
3752
|
local reload_ipc_cmd="${5:-}"
|
|
3719
|
-
local script_path="$
|
|
3753
|
+
local script_path="$(invocation_script_path)"
|
|
3720
3754
|
local quoted_script_path=""
|
|
3721
3755
|
local quoted_help_file=""
|
|
3722
3756
|
local quoted_kbinds_file=""
|
|
3723
3757
|
local preview_cmd
|
|
3724
3758
|
local fzf_shell
|
|
3725
3759
|
|
|
3726
|
-
if [[ "${script_path}" != /* ]]; then
|
|
3727
|
-
script_path="$(pwd)/${script_path}"
|
|
3728
|
-
fi
|
|
3729
|
-
|
|
3730
3760
|
printf -v quoted_script_path "%q" "${script_path}"
|
|
3731
3761
|
printf -v quoted_help_file "%q" "${HELP_FILE}"
|
|
3732
3762
|
printf -v quoted_kbinds_file "%q" "${KBINDS_FILE}"
|
|
@@ -5,6 +5,11 @@ manager_execute_action() {
|
|
|
5
5
|
local package=""
|
|
6
6
|
local pkg=""
|
|
7
7
|
|
|
8
|
+
if [[ "${FPF_USE_GO_MANAGER_ACTIONS:-0}" == "1" && -n "${FPF_SELF_PATH:-}" && -x "${FPF_SELF_PATH}" ]]; then
|
|
9
|
+
"${FPF_SELF_PATH}" --go-manager-action "${action}" --go-manager "${manager}" -- "$@"
|
|
10
|
+
return $?
|
|
11
|
+
fi
|
|
12
|
+
|
|
8
13
|
case "${manager}" in
|
|
9
14
|
apt)
|
|
10
15
|
case "${action}" in
|