fpf-cli 1.6.49 → 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 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.49"
64
+ SCRIPT_VERSION="1.6.50"
7
65
  TMP_ROOT="${TMPDIR:-/tmp}/fpf"
8
66
  SESSION_TMP_ROOT=""
9
67
  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.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
  }