History

Gate embedded commit hash lookup to packaged desktop builds

- Prefer `T3CODE_COMMIT_HASH` when set - Return `null` for unpackaged desktop runs instead of reading embedded metadata

Julius Marminge committed 8 months ago

Commit 8a2f2a51 parent e3197351 file · +13 −2Browse files

Unified · Split

apps/desktop/src/main.ts+13−2
@@ -115,8 +115,19 @@ function resolveAboutCommitHash(): string | null { · 114 unmodified lines
115 return aboutCommitHashCache;115 return aboutCommitHashCache;
116 }116 }
117 117
118 aboutCommitHashCache =118 const envCommitHash = normalizeCommitHash(process.env.T3CODE_COMMIT_HASH);
119 normalizeCommitHash(process.env.T3CODE_COMMIT_HASH) ?? resolveEmbeddedCommitHash();119 if (envCommitHash) {
120 aboutCommitHashCache = envCommitHash;
121 return aboutCommitHashCache;
122 }
123
124 // Only packaged builds are required to expose commit metadata.
125 if (!app.isPackaged) {
126 aboutCommitHashCache = null;
127 return aboutCommitHashCache;
128 }
129
130 aboutCommitHashCache = resolveEmbeddedCommitHash();
120 131
121 return aboutCommitHashCache;132 return aboutCommitHashCache;
122}133}