This repository has been archived by the owner on Jun 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add version info to footer. Generate automatically at build and pick version from package.json (though we can also pick from git or git tags or whatever.
- Loading branch information
1 parent
79fe55a
commit 4ed1771
Showing
6 changed files
with
2,277 additions
and
3,059 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,3 +39,4 @@ testem.log | |
Thumbs.db | ||
|
||
.angular | ||
apps/formule1/src/environments/version.ts |
4 changes: 2 additions & 2 deletions
4
apps/formule1/src/app/components/footer/footer.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<footer class="footer footer-center p-4 bg-base-300 text-base-content"> | ||
<div> | ||
<p> | ||
Website by Martin Spierings - 2023 - Powered by | ||
Website by Martin Spierings - 2023 - v{{version}} - Powered by | ||
<a href="https://ergast.com/mrd/" target="_blank">Ergast</a> | ||
<button class="btn btn-outline btn-sm" (click)="showShare()"> | ||
Share | ||
</button> | ||
</p> | ||
</div> | ||
</footer> | ||
</footer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const { gitDescribeSync } = require('git-describe'); | ||
const { version } = require('./package.json'); | ||
const { resolve, relative } = require('path'); | ||
const { writeFileSync, existsSync, mkdirSync } = require('fs-extra'); | ||
|
||
const gitInfo = gitDescribeSync({ | ||
dirtyMark: false, | ||
dirtySemver: false | ||
}); | ||
|
||
gitInfo.version = version; | ||
|
||
if (!existsSync(__dirname + '/apps/formule1/src/environments')) { | ||
mkdirSync(__dirname + '/apps/formule1/src/environments'); | ||
} | ||
const file = resolve(__dirname, 'apps', 'formule1', 'src', 'environments', 'version.ts'); | ||
writeFileSync(file, | ||
`// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN! | ||
/* eslint-disable */ | ||
export const VERSION = ${JSON.stringify(gitInfo, null, 4)}; | ||
`, { encoding: 'utf-8' }); | ||
|
||
console.log(`Wrote version info ${gitInfo.raw} to ${relative(resolve(__dirname, '..'), file)}`); |
Oops, something went wrong.