From b37ad7d4b19d659f848065a3ce5dd625d0f8c774 Mon Sep 17 00:00:00 2001 From: Alex Schokking Date: Sat, 7 Nov 2026 14:53:22 -0800 Subject: [PATCH] Show Team 488 name in window title and About dialog The window title and About heading are hardcoded to "AdvantageScope", so team builds were indistinguishable from the official app at a glance. The compile job now rewrites them to "AdvantageScope (Team 488)" and marks the About "Distribution" line as a Team 488 build. This replaces the sed step with a small Node step that also handles the update-checker repo. It matches exact strings (sed treats "&" in "—" specially) and fails the build if any target text is missing upstream. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/team-build.yml | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/.github/workflows/team-build.yml b/.github/workflows/team-build.yml index cf94037d9..3053529bf 100644 --- a/.github/workflows/team-build.yml +++ b/.github/workflows/team-build.yml @@ -66,10 +66,30 @@ jobs: run: npm ci env: YOUTUBE_DL_SKIP_DOWNLOAD: "true" - - name: Point update checks and GitHub links at this fork + - name: Apply Team 488 branding + # Point update checks and GitHub links at this fork, and show the + # team name in the window title and About dialog. Fails if upstream + # changes any of the target text, so the branding can't silently drop. run: | - sed -i 's|GITHUB_REPOSITORY = "Mechanical-Advantage/AdvantageScope"|GITHUB_REPOSITORY = "${{ github.repository }}"|' src/main/github.ts - grep -q 'GITHUB_REPOSITORY = "${{ github.repository }}"' src/main/github.ts + node -e ' + const fs = require("fs"); + const name = process.env.PRODUCT_NAME; + const edits = [ + ["src/main/github.ts", `GITHUB_REPOSITORY = "Mechanical-Advantage/AdvantageScope"`, `GITHUB_REPOSITORY = "${process.env.GITHUB_REPOSITORY}"`], + ["src/hub/hub.ts", `" — AdvantageScope" +`, `" — ${name}" +`], + ["src/main/electron/main.ts", `message: "AdvantageScope",`, `message: "${name}",`], + ["src/main/electron/main.ts", `? "WPILib" : "FRC 6328")`, `? "WPILib" : "FRC 6328, Team 488 build")`] + ]; + for (const [file, from, to] of edits) { + const text = fs.readFileSync(file, "utf8"); + if (!text.includes(from)) { + console.log(`::error file=${file}::Branding target not found: ${from}`); + process.exit(1); + } + fs.writeFileSync(file, text.replace(from, () => to)); + console.log(`${file}: ${from} -> ${to}`); + } + ' - name: Compile WebAssembly run: npm run wasm:compile - name: Compile bundles