gearbox-code 0.1.19 → 0.1.20
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/dist/cli.mjs +1 -1
- package/install.sh +23 -17
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -147867,7 +147867,7 @@ init_permission();
|
|
|
147867
147867
|
var jsx_dev_runtime13 = __toESM(require_jsx_dev_runtime(), 1);
|
|
147868
147868
|
process.env.LANG = process.env.LANG || "en_US.UTF-8";
|
|
147869
147869
|
process.env.LC_ALL = process.env.LC_ALL || "en_US.UTF-8";
|
|
147870
|
-
var VERSION16 = "0.1.
|
|
147870
|
+
var VERSION16 = "0.1.20";
|
|
147871
147871
|
var args = process.argv.slice(2);
|
|
147872
147872
|
var supportsAnsi = process.env.FORCE_COLOR === "1" || process.env.TERM !== "dumb" && process.env.NO_COLOR !== "1" && process.stdout.isTTY;
|
|
147873
147873
|
var ansi = (code) => supportsAnsi ? `\x1B[${code}m` : "";
|
package/install.sh
CHANGED
|
@@ -11,6 +11,13 @@
|
|
|
11
11
|
# directory is not on PATH.
|
|
12
12
|
set -euo pipefail
|
|
13
13
|
|
|
14
|
+
# ANSI helpers (no-op when stdout is not a TTY or NO_COLOR is set)
|
|
15
|
+
if [[ -t 1 && "${NO_COLOR:-}" == "" ]]; then
|
|
16
|
+
R=$'\033[0m' B=$'\033[1m' D=$'\033[2m' C=$'\033[36m' G=$'\033[32m' Y=$'\033[33m'
|
|
17
|
+
else
|
|
18
|
+
R='' B='' D='' C='' G='' Y=''
|
|
19
|
+
fi
|
|
20
|
+
|
|
14
21
|
PACKAGE_NAME="${GEARBOX_PACKAGE:-gearbox-code}"
|
|
15
22
|
VERSION="${GEARBOX_VERSION:-latest}"
|
|
16
23
|
INSTALL_ROOT="${GEARBOX_INSTALL_DIR:-${HOME}/.local/share/gearbox}"
|
|
@@ -73,7 +80,7 @@ trap cleanup EXIT
|
|
|
73
80
|
meta_url="https://registry.npmjs.org/${PACKAGE_NAME}/${VERSION}"
|
|
74
81
|
meta_file="${tmp}/meta.json"
|
|
75
82
|
|
|
76
|
-
|
|
83
|
+
printf "${D} → fetching ${PACKAGE_NAME}@${VERSION}${R}\n"
|
|
77
84
|
curl -fsSL "$meta_url" -o "$meta_file"
|
|
78
85
|
|
|
79
86
|
resolved_version="$(node -e 'const fs=require("fs"); const j=JSON.parse(fs.readFileSync(process.argv[1],"utf8")); console.log(j.version || "")' "$meta_file")"
|
|
@@ -88,7 +95,7 @@ target_dir="${INSTALL_ROOT}/${resolved_version}"
|
|
|
88
95
|
archive="${tmp}/package.tgz"
|
|
89
96
|
extract_dir="${tmp}/extract"
|
|
90
97
|
|
|
91
|
-
|
|
98
|
+
printf "${D} → downloading ${PACKAGE_NAME}@${resolved_version}${R}\n"
|
|
92
99
|
curl -fsSL "$tarball_url" -o "$archive"
|
|
93
100
|
mkdir -p "$extract_dir" "$target_dir" "$BIN_DIR"
|
|
94
101
|
tar -xzf "$archive" -C "$extract_dir"
|
|
@@ -111,37 +118,36 @@ exec node "${target_dir}/cli.mjs" "\$@"
|
|
|
111
118
|
EOF
|
|
112
119
|
chmod 0755 "${BIN_DIR}/gearbox"
|
|
113
120
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
121
|
+
printf "\n"
|
|
122
|
+
printf "${G} ✓${R} ${B}gearbox ${resolved_version}${R} installed\n"
|
|
123
|
+
printf "${D} ${BIN_DIR}/gearbox${R}\n"
|
|
124
|
+
printf "\n"
|
|
118
125
|
|
|
119
126
|
case ":${PATH}:" in
|
|
120
127
|
*":${BIN_DIR}:"*)
|
|
121
|
-
|
|
128
|
+
printf " run ${C}gearbox${R} to start\n"
|
|
122
129
|
;;
|
|
123
130
|
*)
|
|
124
131
|
shell_name="$(basename "${SHELL:-sh}")"
|
|
125
132
|
rc_file="${HOME}/.profile"
|
|
126
133
|
if [[ "$shell_name" == "zsh" ]]; then rc_file="${HOME}/.zshrc"; fi
|
|
127
134
|
if [[ "$shell_name" == "bash" ]]; then rc_file="${HOME}/.bashrc"; fi
|
|
128
|
-
|
|
129
|
-
echo "
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
echo "Then run: gearbox"
|
|
135
|
+
printf "${Y} ! ${BIN_DIR} is not on PATH${R}\n"
|
|
136
|
+
printf " echo 'export PATH=\"${BIN_DIR}:\$PATH\"' >> ${rc_file}\n"
|
|
137
|
+
printf " source ${rc_file}\n"
|
|
138
|
+
printf "\n"
|
|
139
|
+
printf " then run ${C}gearbox${R}\n"
|
|
134
140
|
;;
|
|
135
141
|
esac
|
|
136
142
|
|
|
137
143
|
if [[ "${GEARBOX_SKIP_ONBOARD:-}" != "1" ]]; then
|
|
138
|
-
|
|
139
|
-
|
|
144
|
+
printf "\n"
|
|
145
|
+
printf "${D} setting up …${R}\n"
|
|
140
146
|
if [[ -t 1 && -e /dev/tty && -r /dev/tty && -w /dev/tty ]]; then
|
|
141
147
|
if ! "${BIN_DIR}/gearbox" onboard < /dev/tty > /dev/tty; then
|
|
142
|
-
|
|
148
|
+
printf "${Y} setup incomplete — run: ${C}gearbox onboard${R}\n"
|
|
143
149
|
fi
|
|
144
150
|
else
|
|
145
|
-
|
|
151
|
+
printf "${D} no interactive terminal — run: ${C}gearbox onboard${R}\n"
|
|
146
152
|
fi
|
|
147
153
|
fi
|
package/package.json
CHANGED