fix: Use pkg version until semantic-release is used (#1565)

* fix: Use pkg version until semantic-release is used

* Make istanbul happy with coverage
This commit is contained in:
Dermot Duffy
2024-09-22 12:55:44 -07:00
committed by GitHub
parent c63d11a2e9
commit 716a33fb96
2 changed files with 16 additions and 9 deletions
+8 -2
View File
@@ -14,11 +14,17 @@ interface GitDiagnostics {
export const getReleaseVersion = (): string => {
const releaseVersion = '__FRIGATE_CARD_RELEASE_VERSION__';
/* istanbul ignore if: this path cannot be reached during tests as the value
is substituted by rollup -- @preserve */
/* istanbul ignore if: depends on rollup substitution -- @preserve */
if ((releaseVersion as unknown) === 'pkg') {
return pkg.version;
}
/* istanbul ignore if: depends on rollup substitution -- @preserve */
if ((releaseVersion as unknown) === 'dev') {
return `${releaseVersion}+${pkg['gitAbbrevHash']} (${pkg['buildDate']})`;
}
return releaseVersion;
};