fpf-cli 1.6.66 → 1.7.0

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.
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/fpf ADDED
@@ -0,0 +1,129 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -euo pipefail
4
+
5
+ resolve_script_path() {
6
+ local source_path="$1"
7
+ local source_dir=""
8
+ local link_target=""
9
+
10
+ while [[ -h "${source_path}" ]]; do
11
+ source_dir="$(cd -P "$(dirname "${source_path}")" && pwd)"
12
+ link_target="$(readlink "${source_path}")"
13
+ if [[ "${link_target}" == /* ]]; then
14
+ source_path="${link_target}"
15
+ else
16
+ source_path="${source_dir}/${link_target}"
17
+ fi
18
+ done
19
+
20
+ source_dir="$(cd -P "$(dirname "${source_path}")" && pwd)"
21
+ printf "%s/%s" "${source_dir}" "$(basename "${source_path}")"
22
+ }
23
+
24
+ main() {
25
+ local script_path=""
26
+ local script_dir=""
27
+ local uname_s=""
28
+ local uname_m=""
29
+ local goos=""
30
+ local goarch=""
31
+ local candidate=""
32
+
33
+ script_path="$(resolve_script_path "${BASH_SOURCE[0]}")"
34
+ script_dir="$(cd -P "$(dirname "${script_path}")" && pwd)"
35
+ if [[ "${FPF_SKIP_GO_BOOTSTRAP:-0}" == "1" ]]; then
36
+ case "${OSTYPE:-}" in
37
+ linux*)
38
+ uname_s="Linux"
39
+ ;;
40
+ darwin*)
41
+ uname_s="Darwin"
42
+ ;;
43
+ msys*|cygwin*|win32*)
44
+ uname_s="MINGW"
45
+ ;;
46
+ *)
47
+ uname_s="$(uname -s 2>/dev/null || true)"
48
+ ;;
49
+ esac
50
+
51
+ case "${HOSTTYPE:-${MACHTYPE:-}}" in
52
+ *x86_64*|*amd64*)
53
+ uname_m="x86_64"
54
+ ;;
55
+ *aarch64*|*arm64*)
56
+ uname_m="arm64"
57
+ ;;
58
+ *)
59
+ uname_m="$(uname -m 2>/dev/null || true)"
60
+ ;;
61
+ esac
62
+ else
63
+ uname_s="$(uname -s 2>/dev/null || true)"
64
+ uname_m="$(uname -m 2>/dev/null || true)"
65
+ fi
66
+
67
+ case "${uname_s}" in
68
+ Linux)
69
+ goos="linux"
70
+ ;;
71
+ Darwin)
72
+ goos="darwin"
73
+ ;;
74
+ MINGW*|MSYS*|CYGWIN*)
75
+ goos="windows"
76
+ ;;
77
+ *)
78
+ printf "fpf: unsupported OS '%s'\n" "${uname_s}" >&2
79
+ exit 1
80
+ ;;
81
+ esac
82
+
83
+ case "${uname_m}" in
84
+ x86_64|amd64)
85
+ goarch="amd64"
86
+ ;;
87
+ arm64|aarch64)
88
+ goarch="arm64"
89
+ ;;
90
+ *)
91
+ goarch=""
92
+ ;;
93
+ esac
94
+
95
+ if [[ -n "${goarch}" ]]; then
96
+ candidate="${script_dir}/bin/fpf-go-${goos}-${goarch}"
97
+ if [[ "${goos}" == "windows" ]]; then
98
+ candidate="${candidate}.exe"
99
+ fi
100
+ if [[ -x "${candidate}" ]]; then
101
+ export FPF_PACKAGE_JSON="${script_dir}/package.json"
102
+ exec "${candidate}" "$@"
103
+ fi
104
+ fi
105
+
106
+ for goarch in amd64 arm64; do
107
+ candidate="${script_dir}/bin/fpf-go-${goos}-${goarch}"
108
+ if [[ "${goos}" == "windows" ]]; then
109
+ candidate="${candidate}.exe"
110
+ fi
111
+ if [[ -x "${candidate}" ]]; then
112
+ export FPF_PACKAGE_JSON="${script_dir}/package.json"
113
+ exec "${candidate}" "$@"
114
+ fi
115
+ done
116
+
117
+ printf "fpf: missing packaged Go binary for %s/%s\n" "${goos}" "${uname_m}" >&2
118
+ printf "fpf: expected one of:\n" >&2
119
+ printf " %s/bin/fpf-go-%s-amd64\n" "${script_dir}" "${goos}" >&2
120
+ printf " %s/bin/fpf-go-%s-arm64\n" "${script_dir}" "${goos}" >&2
121
+ if [[ "${goos}" == "windows" ]]; then
122
+ printf " (with .exe suffix on Windows binaries)\n" >&2
123
+ fi
124
+ printf "fpf: run 'bash scripts/build-go-binaries.sh' to build local binaries.\n" >&2
125
+ exit 1
126
+
127
+ }
128
+
129
+ main "$@"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fpf-cli",
3
- "version": "1.6.66",
3
+ "version": "1.7.0",
4
4
  "description": "Cross-platform fuzzy package finder powered by fzf",
5
5
  "bin": {
6
6
  "fpf": "fpf"