feat(version): expose build metadata
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
parent
7490f34267
commit
7ca8cd8551
3 changed files with 13 additions and 4 deletions
|
|
@ -29,6 +29,8 @@ type VersionInfo = {
|
|||
commitHash: string | null;
|
||||
commitDate: string | null;
|
||||
commitSubject: string | null;
|
||||
lastUpdated: string | null;
|
||||
commitMessage: string | null;
|
||||
buildTime: string | null;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ const EMPTY: VersionInfo = {
|
|||
commitHash: null,
|
||||
commitDate: null,
|
||||
commitSubject: null,
|
||||
lastUpdated: null,
|
||||
commitMessage: null,
|
||||
buildTime: null,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ const EMPTY: VersionInfo = {
|
|||
commitHash: null,
|
||||
commitDate: null,
|
||||
commitSubject: null,
|
||||
lastUpdated: null,
|
||||
commitMessage: null,
|
||||
buildTime: null,
|
||||
};
|
||||
|
||||
|
|
@ -50,11 +52,14 @@ const VersionOverlay = ({ canSeeCommit }: { canSeeCommit: boolean }) => {
|
|||
|
||||
const resolved = info ?? EMPTY;
|
||||
const versionLabel = resolveVersionLabel(resolved);
|
||||
const lastUpdated = formatCommitDate(resolved.commitDate);
|
||||
const lastUpdated = formatCommitDate(
|
||||
resolved.lastUpdated ?? resolved.commitDate ?? resolved.buildTime,
|
||||
);
|
||||
const commitMessage = resolved.commitMessage ?? resolved.commitSubject;
|
||||
const commitInfo =
|
||||
resolved.commitHash && resolved.commitSubject
|
||||
? `${resolved.commitHash} · ${resolved.commitSubject}`
|
||||
: (resolved.commitHash ?? resolved.commitSubject ?? null);
|
||||
resolved.commitHash && commitMessage
|
||||
? `${resolved.commitHash} · ${commitMessage}`
|
||||
: (resolved.commitHash ?? commitMessage ?? null);
|
||||
const showSecondary = lastUpdated !== null || commitInfo !== null;
|
||||
|
||||
return (
|
||||
|
|
|
|||
Loading…
Reference in a new issue