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
This commit is contained in:
1 parent
489fe2db59
commit
bb1eb98a8b
1 file changed
+13
-2
@@ -115,8 +115,19 @@ function resolveAboutCommitHash(): string | null {
|
||||
return aboutCommitHashCache;
|
||||
}
|
||||
|
||||
aboutCommitHashCache =
|
||||
normalizeCommitHash(process.env.T3CODE_COMMIT_HASH) ?? resolveEmbeddedCommitHash();
|
||||
const envCommitHash = normalizeCommitHash(process.env.T3CODE_COMMIT_HASH);
|
||||
if (envCommitHash) {
|
||||
aboutCommitHashCache = envCommitHash;
|
||||
return aboutCommitHashCache;
|
||||
}
|
||||
|
||||
// Only packaged builds are required to expose commit metadata.
|
||||
if (!app.isPackaged) {
|
||||
aboutCommitHashCache = null;
|
||||
return aboutCommitHashCache;
|
||||
}
|
||||
|
||||
aboutCommitHashCache = resolveEmbeddedCommitHash();
|
||||
|
||||
return aboutCommitHashCache;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user