build: change way to extract version 2

This commit is contained in:
Johannes Millan 2021-09-23 17:51:35 +02:00
parent 6a44f83566
commit 29245715a9

View file

@ -1,6 +1,6 @@
// inspired by: https://stackoverflow.com/questions/42155115/how-to-include-git-revision-into-angular-cli-application
// const fs = require('fs');
const fs = require('fs');
// const { exec, execSync } = require('child_process');
// const revision = process.env.execSync('git rev-parse --short HEAD').toString().trim();
// const branch = execSync('git rev-parse --abbrev-ref HEAD').toString().trim();
@ -11,7 +11,7 @@ const branch = process.env.GITHUB_SHA || 'NO_BRANCH';
const content = `// this file is automatically generated by git.version.ts script
export const versions = {
version: '${process.env.npm_package_version}',
version: '${version}',
revision: '${revision}',
branch: '${branch}',
};