fpf-cli 1.6.48 → 1.6.50
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/README.md +3 -0
- package/bin/fpf-go-darwin-amd64 +0 -0
- package/bin/fpf-go-darwin-arm64 +0 -0
- package/bin/fpf-go-linux-amd64 +0 -0
- package/bin/fpf-go-linux-arm64 +0 -0
- package/bin/fpf-go-windows-amd64.exe +0 -0
- package/bin/fpf-go-windows-arm64.exe +0 -0
- package/fpf +118 -30
- package/lib/fpf/manager-actions.sh +5 -0
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -16,6 +16,9 @@ npm install -g fpf-cli
|
|
|
16
16
|
bun add -g fpf-cli
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
+
`npm`/`bun` installs now bundle prebuilt Go helper binaries for Linux/macOS/Windows (`amd64` + `arm64`).
|
|
20
|
+
When available, `fpf` auto-executes the packaged Go binary first, then falls back to the legacy Bash-only path.
|
|
21
|
+
|
|
19
22
|
## Quick Start
|
|
20
23
|
|
|
21
24
|
```bash
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/fpf
CHANGED
|
@@ -2,8 +2,66 @@
|
|
|
2
2
|
|
|
3
3
|
set -euo pipefail
|
|
4
4
|
|
|
5
|
+
try_exec_packaged_go_binary() {
|
|
6
|
+
if [[ "${FPF_SKIP_GO_BOOTSTRAP:-0}" == "1" ]]; then
|
|
7
|
+
return
|
|
8
|
+
fi
|
|
9
|
+
|
|
10
|
+
local script_dir=""
|
|
11
|
+
local uname_s=""
|
|
12
|
+
local uname_m=""
|
|
13
|
+
local goos=""
|
|
14
|
+
local goarch=""
|
|
15
|
+
local candidate=""
|
|
16
|
+
|
|
17
|
+
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
18
|
+
uname_s="$(uname -s 2>/dev/null || true)"
|
|
19
|
+
uname_m="$(uname -m 2>/dev/null || true)"
|
|
20
|
+
|
|
21
|
+
case "${uname_s}" in
|
|
22
|
+
Linux)
|
|
23
|
+
goos="linux"
|
|
24
|
+
;;
|
|
25
|
+
Darwin)
|
|
26
|
+
goos="darwin"
|
|
27
|
+
;;
|
|
28
|
+
MINGW*|MSYS*|CYGWIN*)
|
|
29
|
+
goos="windows"
|
|
30
|
+
;;
|
|
31
|
+
*)
|
|
32
|
+
return
|
|
33
|
+
;;
|
|
34
|
+
esac
|
|
35
|
+
|
|
36
|
+
case "${uname_m}" in
|
|
37
|
+
x86_64|amd64)
|
|
38
|
+
goarch="amd64"
|
|
39
|
+
;;
|
|
40
|
+
arm64|aarch64)
|
|
41
|
+
goarch="arm64"
|
|
42
|
+
;;
|
|
43
|
+
*)
|
|
44
|
+
return
|
|
45
|
+
;;
|
|
46
|
+
esac
|
|
47
|
+
|
|
48
|
+
candidate="${script_dir}/bin/fpf-go-${goos}-${goarch}"
|
|
49
|
+
if [[ "${goos}" == "windows" ]]; then
|
|
50
|
+
candidate="${candidate}.exe"
|
|
51
|
+
fi
|
|
52
|
+
|
|
53
|
+
if [[ -x "${candidate}" ]]; then
|
|
54
|
+
export FPF_SKIP_GO_BOOTSTRAP=1
|
|
55
|
+
export FPF_LEGACY_SCRIPT="${script_dir}/fpf"
|
|
56
|
+
export FPF_PACKAGE_JSON="${script_dir}/package.json"
|
|
57
|
+
exec "${candidate}" "$@"
|
|
58
|
+
fi
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
try_exec_packaged_go_binary "$@"
|
|
62
|
+
|
|
5
63
|
SCRIPT_NAME="fpf"
|
|
6
|
-
SCRIPT_VERSION="1.6.
|
|
64
|
+
SCRIPT_VERSION="1.6.50"
|
|
7
65
|
TMP_ROOT="${TMPDIR:-/tmp}/fpf"
|
|
8
66
|
SESSION_TMP_ROOT=""
|
|
9
67
|
HELP_FILE=""
|
|
@@ -369,6 +427,16 @@ command_exists() {
|
|
|
369
427
|
command -v "$1" >/dev/null 2>&1
|
|
370
428
|
}
|
|
371
429
|
|
|
430
|
+
invocation_script_path() {
|
|
431
|
+
local script_path="${FPF_SELF_PATH:-${BASH_SOURCE[0]}}"
|
|
432
|
+
|
|
433
|
+
if [[ "${script_path}" != /* ]]; then
|
|
434
|
+
script_path="$(pwd)/${script_path}"
|
|
435
|
+
fi
|
|
436
|
+
|
|
437
|
+
printf "%s" "${script_path}"
|
|
438
|
+
}
|
|
439
|
+
|
|
372
440
|
resolve_script_dir() {
|
|
373
441
|
local script_path="${BASH_SOURCE[0]}"
|
|
374
442
|
local script_dir=""
|
|
@@ -1035,10 +1103,6 @@ start_bun_refresh_worker_async() {
|
|
|
1035
1103
|
local manager_override="$8"
|
|
1036
1104
|
local script_path="${BASH_SOURCE[0]}"
|
|
1037
1105
|
|
|
1038
|
-
if [[ "${script_path}" != /* ]]; then
|
|
1039
|
-
script_path="$(pwd)/${script_path}"
|
|
1040
|
-
fi
|
|
1041
|
-
|
|
1042
1106
|
FPF_BUN_REFRESH_FLAGS="${flags}" \
|
|
1043
1107
|
FPF_BUN_REFRESH_KEY="${key}" \
|
|
1044
1108
|
FPF_BUN_REFRESH_FINGERPRINT="${fingerprint}" \
|
|
@@ -2295,6 +2359,11 @@ rank_display_rows_by_query() {
|
|
|
2295
2359
|
local has_exact=0
|
|
2296
2360
|
local candidate
|
|
2297
2361
|
|
|
2362
|
+
if [[ "${FPF_USE_GO_DISPLAY_PIPELINE:-0}" == "1" && -n "${FPF_SELF_PATH:-}" && -x "${FPF_SELF_PATH}" ]]; then
|
|
2363
|
+
"${FPF_SELF_PATH}" --go-rank-display --go-query "${query}" --go-input "${input_file}"
|
|
2364
|
+
return $?
|
|
2365
|
+
fi
|
|
2366
|
+
|
|
2298
2367
|
[[ -n "${query}" ]] || return 0
|
|
2299
2368
|
|
|
2300
2369
|
while IFS= read -r candidate; do
|
|
@@ -2523,6 +2592,35 @@ manager_search_entries_uncached() {
|
|
|
2523
2592
|
esac
|
|
2524
2593
|
fi
|
|
2525
2594
|
|
|
2595
|
+
if [[ "${FPF_USE_GO_SEARCH_ENTRIES:-0}" == "1" && -n "${FPF_SELF_PATH:-}" && -x "${FPF_SELF_PATH}" ]]; then
|
|
2596
|
+
case "${manager}" in
|
|
2597
|
+
apt|brew)
|
|
2598
|
+
;;
|
|
2599
|
+
flatpak)
|
|
2600
|
+
if [[ -z "${query}" ]]; then
|
|
2601
|
+
:
|
|
2602
|
+
else
|
|
2603
|
+
"${FPF_SELF_PATH}" \
|
|
2604
|
+
--go-search-entries \
|
|
2605
|
+
--go-manager "${manager}" \
|
|
2606
|
+
--go-query "${effective_query}" \
|
|
2607
|
+
--go-limit "${effective_limit}" \
|
|
2608
|
+
--go-npm-search-limit "${npm_search_limit}"
|
|
2609
|
+
return 0
|
|
2610
|
+
fi
|
|
2611
|
+
;;
|
|
2612
|
+
*)
|
|
2613
|
+
"${FPF_SELF_PATH}" \
|
|
2614
|
+
--go-search-entries \
|
|
2615
|
+
--go-manager "${manager}" \
|
|
2616
|
+
--go-query "${effective_query}" \
|
|
2617
|
+
--go-limit "${effective_limit}" \
|
|
2618
|
+
--go-npm-search-limit "${npm_search_limit}"
|
|
2619
|
+
return 0
|
|
2620
|
+
;;
|
|
2621
|
+
esac
|
|
2622
|
+
fi
|
|
2623
|
+
|
|
2526
2624
|
case "${manager}" in
|
|
2527
2625
|
apt)
|
|
2528
2626
|
if search_entries_from_catalog_cache "${manager}" "${effective_query}"; then
|
|
@@ -2799,6 +2897,11 @@ manager_search_entries() {
|
|
|
2799
2897
|
manager_installed_entries() {
|
|
2800
2898
|
local manager="$1"
|
|
2801
2899
|
|
|
2900
|
+
if [[ "${FPF_USE_GO_INSTALLED_ENTRIES:-0}" == "1" && -n "${FPF_SELF_PATH:-}" && -x "${FPF_SELF_PATH}" ]]; then
|
|
2901
|
+
"${FPF_SELF_PATH}" --go-installed-entries --go-manager "${manager}"
|
|
2902
|
+
return $?
|
|
2903
|
+
fi
|
|
2904
|
+
|
|
2802
2905
|
case "${manager}" in
|
|
2803
2906
|
apt)
|
|
2804
2907
|
dpkg-query -W -f='${binary:Package}\t${Version}\n' 2>/dev/null
|
|
@@ -3184,6 +3287,11 @@ merge_search_display_rows() {
|
|
|
3184
3287
|
local source_file="$1"
|
|
3185
3288
|
local output_file="$2"
|
|
3186
3289
|
|
|
3290
|
+
if [[ "${FPF_USE_GO_DISPLAY_PIPELINE:-0}" == "1" && -n "${FPF_SELF_PATH:-}" && -x "${FPF_SELF_PATH}" ]]; then
|
|
3291
|
+
"${FPF_SELF_PATH}" --go-merge-display --go-source "${source_file}" --go-output "${output_file}"
|
|
3292
|
+
return $?
|
|
3293
|
+
fi
|
|
3294
|
+
|
|
3187
3295
|
if [[ ! -s "${source_file}" ]]; then
|
|
3188
3296
|
: >"${output_file}"
|
|
3189
3297
|
return
|
|
@@ -3344,15 +3452,11 @@ build_dynamic_reload_command() {
|
|
|
3344
3452
|
local manager_override="$1"
|
|
3345
3453
|
local fallback_file="$2"
|
|
3346
3454
|
local manager_list_csv="${3:-}"
|
|
3347
|
-
local script_path="$
|
|
3455
|
+
local script_path="$(invocation_script_path)"
|
|
3348
3456
|
local bypass_query_cache="1"
|
|
3349
3457
|
|
|
3350
3458
|
bypass_query_cache="$(dynamic_reload_query_cache_bypass_value)"
|
|
3351
3459
|
|
|
3352
|
-
if [[ "${script_path}" != /* ]]; then
|
|
3353
|
-
script_path="$(pwd)/${script_path}"
|
|
3354
|
-
fi
|
|
3355
|
-
|
|
3356
3460
|
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
3461
|
}
|
|
3358
3462
|
|
|
@@ -3361,15 +3465,11 @@ build_dynamic_reload_command_for_query() {
|
|
|
3361
3465
|
local fallback_file="$2"
|
|
3362
3466
|
local manager_list_csv="$3"
|
|
3363
3467
|
local query_value="$4"
|
|
3364
|
-
local script_path="$
|
|
3468
|
+
local script_path="$(invocation_script_path)"
|
|
3365
3469
|
local bypass_query_cache="1"
|
|
3366
3470
|
|
|
3367
3471
|
bypass_query_cache="$(dynamic_reload_query_cache_bypass_value)"
|
|
3368
3472
|
|
|
3369
|
-
if [[ "${script_path}" != /* ]]; then
|
|
3370
|
-
script_path="$(pwd)/${script_path}"
|
|
3371
|
-
fi
|
|
3372
|
-
|
|
3373
3473
|
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
3474
|
}
|
|
3375
3475
|
|
|
@@ -3377,11 +3477,7 @@ build_dynamic_reload_ipc_command() {
|
|
|
3377
3477
|
local manager_override="$1"
|
|
3378
3478
|
local fallback_file="$2"
|
|
3379
3479
|
local manager_list_csv="${3:-}"
|
|
3380
|
-
local script_path="$
|
|
3381
|
-
|
|
3382
|
-
if [[ "${script_path}" != /* ]]; then
|
|
3383
|
-
script_path="$(pwd)/${script_path}"
|
|
3384
|
-
fi
|
|
3480
|
+
local script_path="$(invocation_script_path)"
|
|
3385
3481
|
|
|
3386
3482
|
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
3483
|
}
|
|
@@ -3390,11 +3486,7 @@ build_dynamic_query_notify_ipc_command() {
|
|
|
3390
3486
|
local manager_override="$1"
|
|
3391
3487
|
local fallback_file="$2"
|
|
3392
3488
|
local manager_list_csv="${3:-}"
|
|
3393
|
-
local script_path="$
|
|
3394
|
-
|
|
3395
|
-
if [[ "${script_path}" != /* ]]; then
|
|
3396
|
-
script_path="$(pwd)/${script_path}"
|
|
3397
|
-
fi
|
|
3489
|
+
local script_path="$(invocation_script_path)"
|
|
3398
3490
|
|
|
3399
3491
|
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
3492
|
}
|
|
@@ -3716,17 +3808,13 @@ run_fuzzy_selector() {
|
|
|
3716
3808
|
local header_line="$3"
|
|
3717
3809
|
local reload_cmd="${4:-}"
|
|
3718
3810
|
local reload_ipc_cmd="${5:-}"
|
|
3719
|
-
local script_path="$
|
|
3811
|
+
local script_path="$(invocation_script_path)"
|
|
3720
3812
|
local quoted_script_path=""
|
|
3721
3813
|
local quoted_help_file=""
|
|
3722
3814
|
local quoted_kbinds_file=""
|
|
3723
3815
|
local preview_cmd
|
|
3724
3816
|
local fzf_shell
|
|
3725
3817
|
|
|
3726
|
-
if [[ "${script_path}" != /* ]]; then
|
|
3727
|
-
script_path="$(pwd)/${script_path}"
|
|
3728
|
-
fi
|
|
3729
|
-
|
|
3730
3818
|
printf -v quoted_script_path "%q" "${script_path}"
|
|
3731
3819
|
printf -v quoted_help_file "%q" "${HELP_FILE}"
|
|
3732
3820
|
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
|
package/package.json
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fpf-cli",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.50",
|
|
4
4
|
"description": "Cross-platform fuzzy package finder powered by fzf",
|
|
5
5
|
"bin": {
|
|
6
6
|
"fpf": "fpf"
|
|
7
7
|
},
|
|
8
8
|
"files": [
|
|
9
9
|
"fpf",
|
|
10
|
+
"bin/fpf-go-*",
|
|
11
|
+
"bin/fpf-go-*.exe",
|
|
10
12
|
"lib/fpf/*.sh",
|
|
11
13
|
"README.md",
|
|
12
14
|
"LICENSE",
|
|
@@ -42,6 +44,7 @@
|
|
|
42
44
|
"node": ">=18"
|
|
43
45
|
},
|
|
44
46
|
"scripts": {
|
|
45
|
-
"test": "bash tests/smoke.sh"
|
|
47
|
+
"test": "bash tests/smoke.sh",
|
|
48
|
+
"prepack": "bash scripts/build-go-binaries.sh"
|
|
46
49
|
}
|
|
47
50
|
}
|