Skip to content

Commit 613ab60

Browse files
committed
Make suggested changes from review
1 parent 9b578ad commit 613ab60

File tree

8 files changed

+634
-308
lines changed

8 files changed

+634
-308
lines changed

.github/workflows/pages.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ jobs:
3333
bun install
3434
bun run build
3535
36-
# To deploy to a custom domain (e.g. flashpack.comma.ai),
37-
# uncomment this step and configure DNS to point to GitHub Pages
38-
# - name: set custom domain
39-
# run: echo "flashpack.comma.ai" > tools/flashpack/dist/CNAME
40-
4136
- name: configure pages
4237
uses: actions/configure-pages@v5
4338

tools/flashpack/build.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1+
const gitSha = Bun.spawnSync(["git", "rev-parse", "HEAD"]).stdout.toString().trim();
2+
13
const build = await Bun.build({
24
entrypoints: ["./src/index.html"],
35
outdir: "./dist",
46
sourcemap: "linked",
57
minify: true,
8+
define: {
9+
"process.env.GIT_SHA": JSON.stringify(gitSha),
10+
},
611
});
712

813
if (!build.success) {

tools/flashpack/setup-udev.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.

tools/flashpack/src/app.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { FlashManager, Step, ErrorCode, loadProgrammer } from "./utils/manager";
22
import { getManifest } from "./utils/manifest";
33

4-
import portsThree from "./assets/qdl-ports-three.svg";
4+
import portsThree from "./assets/qdl-ports-threex.svg";
55
import portsFour from "./assets/qdl-ports-four.svg";
66
import comma3X from "./assets/comma3X.webp";
77
import commaFour from "./assets/four_screen_on.webp";
@@ -333,11 +333,16 @@ async function init() {
333333
$("init-status").textContent = "loading programmer + manifest...";
334334

335335
try {
336-
const [programmer, manifest] = await Promise.all([
336+
const [programmer, { version, manifest }] = await Promise.all([
337337
loadProgrammer(),
338338
getManifest(),
339339
]);
340340

341+
const sha = process.env.GIT_SHA || "master";
342+
const versionLink = document.getElementById("version-link") as HTMLAnchorElement;
343+
versionLink.href = `https://github.com/commaai/vamOS/tree/${sha}`;
344+
versionLink.textContent = sha.slice(0, 7);
345+
341346
console.info("[flashpack] Manifest loaded:", manifest.length, "entries");
342347
manager = new FlashManager(programmer, {});
343348
await manager.initialize(manifest);
@@ -346,7 +351,7 @@ async function init() {
346351
throw new Error("Initialization failed");
347352
}
348353

349-
$("init-status").textContent = `ready! (${manager.step === Step.READY ? "manifest loaded" : "..."})`;
354+
$("init-status").textContent = "";
350355
($("btn-start") as HTMLButtonElement).disabled = false;
351356
} catch (err: any) {
352357
console.error("[flashpack] Init failed:", err);
File renamed without changes.

0 commit comments

Comments
 (0)