Show the source branch on development builds (#3216)

Development web and Electron builds now show their source branch in the expanded sidebar, including a branch icon and safe truncation. Dev launchers inject the label at build time; production builds remain unchanged.
This commit is contained in:
Mohamed Boudra
2026-08-11 14:18:06 +02:00
committed by GitHub
parent 8c003351d0
commit 917e39495b
6 changed files with 50 additions and 2 deletions
+6 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env node
import net from "node:net";
import path from "node:path";
import { spawn } from "node:child_process";
import { execFileSync, spawn } from "node:child_process";
import { createRequire } from "node:module";
import { fileURLToPath } from "node:url";
import { createElectronSpawnOptions, resolveChildKillTarget } from "./dev-runner-config.mjs";
@@ -27,6 +27,10 @@ const colorEnv = {
FORCE_COLOR: process.env.FORCE_COLOR || "1",
npm_config_color: process.env.npm_config_color || "always",
};
const devBuildLabel = execFileSync("git", ["branch", "--show-current"], {
cwd: rootDir,
encoding: "utf8",
}).trim();
const children = new Map();
let stopping = false;
@@ -166,6 +170,7 @@ spawnChild("metro", "npx", ["expo", "start", "--port", String(expoPort)], {
...colorEnv,
BROWSER: "none",
APP_VARIANT: "development",
EXPO_PUBLIC_PASEO_DEV_BUILD_LABEL: devBuildLabel,
PASEO_WEB_PLATFORM: "electron",
},
});
+1
View File
@@ -32,6 +32,7 @@ try {
# Set EXPO_DEV_URL in the environment so Electron inherits it
$env:EXPO_DEV_URL = "http://localhost:$($env:EXPO_PORT)"
$env:EXPO_PUBLIC_PASEO_DEV_BUILD_LABEL = (git -C $RootDir branch --show-current).Trim()
$env:PASEO_DEV_ROOT = $RootDir
$env:PASEO_DEV_RUNTIME_FALLBACK_ROOT = $RootDir