Installing meant Bun, a clone with the T3 Code submodule and a build. Now a tag builds a binary per platform with bun build --compile, carrying Bun's runtime and OpenTUI's native library, and publishes them as a GitHub Release after opening each one's dashboard on its own OS. install.sh picks the right binary and checks it against SHA256SUMS; `t3tui upgrade` replaces an installed binary with the latest release and `t3tui version` prints the version. `t3tui tmux` started its windows as `bun <file>`, which a compiled binary can't do, so it now runs itself.
19 lines
658 B
TypeScript
19 lines
658 B
TypeScript
import { expect, test } from "bun:test";
|
|
|
|
import { assetName, checksumFor, isCompiled } from "../src/upgrade.ts";
|
|
|
|
test("names the release asset for a platform", () => {
|
|
expect(assetName("darwin", "arm64")).toBe("t3tui-darwin-arm64");
|
|
});
|
|
|
|
test("reads a hash from a sha256sum listing", () => {
|
|
const sums = "aaa t3tui-linux-x64.gz\nbbb *t3tui-darwin-arm64.gz\n";
|
|
expect(checksumFor(sums, "t3tui-linux-x64.gz")).toBe("aaa");
|
|
expect(checksumFor(sums, "t3tui-darwin-arm64.gz")).toBe("bbb");
|
|
expect(checksumFor(sums, "t3tui-linux-arm64.gz")).toBeUndefined();
|
|
});
|
|
|
|
test("knows it's running from source", () => {
|
|
expect(isCompiled()).toBe(false);
|
|
});
|