tiller-app 1.0.0 → 1.0.2

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.
Files changed (2) hide show
  1. package/bin/tiller.mjs +28 -1
  2. package/package.json +2 -2
package/bin/tiller.mjs CHANGED
@@ -95,6 +95,24 @@ async function install(dir, key) {
95
95
  });
96
96
  if (extract.status !== 0) throw new Error(`could not extract ${archive}`);
97
97
  fs.rmSync(file);
98
+ const validate = spawnSync(
99
+ path.join(staging, process.platform === "win32" ? "tiller.exe" : "tiller"), // fork(launch)
100
+ ["--version"],
101
+ {
102
+ stdio: ["ignore", "ignore", "pipe"],
103
+ encoding: "utf8",
104
+ timeout: 30_000,
105
+ killSignal: "SIGKILL",
106
+ },
107
+ );
108
+ if (validate.status !== 0) {
109
+ throw executableError(
110
+ key,
111
+ validate.error?.message ||
112
+ validate.stderr?.trim() ||
113
+ `--version exited with ${validate.signal || validate.status}`,
114
+ );
115
+ }
98
116
  fs.writeFileSync(path.join(staging, ".install-complete"), `${version}\n`);
99
117
  publish(staging, dir);
100
118
  } finally {
@@ -187,12 +205,21 @@ async function main() {
187
205
  for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) {
188
206
  process.on(signal, () => (ipc || signal !== "SIGINT") && child.kill(signal));
189
207
  }
190
- child.on("error", (error) => fail(error));
208
+ child.on("error", (error) => fail(executableError(key, error.message)));
191
209
  child.on("exit", (code, signal) =>
192
210
  process.exit(code ?? 128 + (os.constants.signals[signal] || 1)),
193
211
  );
194
212
  }
195
213
 
214
+ function executableError(key, detail) {
215
+ return new Error(
216
+ `could not run T3 Code ${version} for ${key}: ${detail}` +
217
+ (process.platform === "linux"
218
+ ? "\nThe Linux release requires glibc; musl-based systems such as Alpine are not supported. Use a glibc-based Linux environment."
219
+ : ""),
220
+ );
221
+ }
222
+
196
223
  function fail(error) {
197
224
  // fork(launch)
198
225
  process.stderr.write(`tiller: ${error.message}\n`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tiller-app",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Tiller CLI (Apple Silicon Macs only). Downloads the self-contained executable for this platform from the GitHub Release.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": "github:Antler-Web-Studios/tiller",
@@ -17,6 +17,6 @@
17
17
  "node": ">=20.11"
18
18
  },
19
19
  "t3code": {
20
- "databaseMigration": 77
20
+ "databaseMigration": 79
21
21
  }
22
22
  }