fpf-cli 1.6.49 → 1.6.51

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 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,87 @@
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_path=""
11
+ local script_dir=""
12
+ local uname_s=""
13
+ local uname_m=""
14
+ local goos=""
15
+ local goarch=""
16
+ local candidate=""
17
+
18
+ script_path="$(resolve_script_path "${BASH_SOURCE[0]}")"
19
+ script_dir="$(cd -P "$(dirname "${script_path}")" && pwd)"
20
+ uname_s="$(uname -s 2>/dev/null || true)"
21
+ uname_m="$(uname -m 2>/dev/null || true)"
22
+
23
+ case "${uname_s}" in
24
+ Linux)
25
+ goos="linux"
26
+ ;;
27
+ Darwin)
28
+ goos="darwin"
29
+ ;;
30
+ MINGW*|MSYS*|CYGWIN*)
31
+ goos="windows"
32
+ ;;
33
+ *)
34
+ return
35
+ ;;
36
+ esac
37
+
38
+ case "${uname_m}" in
39
+ x86_64|amd64)
40
+ goarch="amd64"
41
+ ;;
42
+ arm64|aarch64)
43
+ goarch="arm64"
44
+ ;;
45
+ *)
46
+ return
47
+ ;;
48
+ esac
49
+
50
+ candidate="${script_dir}/bin/fpf-go-${goos}-${goarch}"
51
+ if [[ "${goos}" == "windows" ]]; then
52
+ candidate="${candidate}.exe"
53
+ fi
54
+
55
+ if [[ -x "${candidate}" ]]; then
56
+ export FPF_SKIP_GO_BOOTSTRAP=1
57
+ export FPF_LEGACY_SCRIPT="${script_dir}/fpf"
58
+ export FPF_PACKAGE_JSON="${script_dir}/package.json"
59
+ exec "${candidate}" "$@"
60
+ fi
61
+ }
62
+
63
+ resolve_script_path() {
64
+ local source_path="$1"
65
+ local source_dir=""
66
+ local link_target=""
67
+
68
+ while [[ -h "${source_path}" ]]; do
69
+ source_dir="$(cd -P "$(dirname "${source_path}")" && pwd)"
70
+ link_target="$(readlink "${source_path}")"
71
+ if [[ "${link_target}" == /* ]]; then
72
+ source_path="${link_target}"
73
+ else
74
+ source_path="${source_dir}/${link_target}"
75
+ fi
76
+ done
77
+
78
+ source_dir="$(cd -P "$(dirname "${source_path}")" && pwd)"
79
+ printf "%s/%s" "${source_dir}" "$(basename "${source_path}")"
80
+ }
81
+
82
+ try_exec_packaged_go_binary "$@"
83
+
5
84
  SCRIPT_NAME="fpf"
6
- SCRIPT_VERSION="1.6.49"
85
+ SCRIPT_VERSION="1.6.51"
7
86
  TMP_ROOT="${TMPDIR:-/tmp}/fpf"
8
87
  SESSION_TMP_ROOT=""
9
88
  HELP_FILE=""
package/package.json CHANGED
@@ -1,12 +1,14 @@
1
1
  {
2
2
  "name": "fpf-cli",
3
- "version": "1.6.49",
3
+ "version": "1.6.51",
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
  }