Skip to content

Commit

Permalink
Update version.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfred-Mutai authored Feb 15, 2024
1 parent bd5ea3a commit e714442
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions version.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,18 @@ const { version } = require('./package.json');
const { resolve, relative } = require('path');
const { writeFileSync } = require('fs-extra');
const gitInfo = gitDescribeSync({
dirtyMark: false,
dirtySemver: false
dirtyMark: false,
dirtySemver: false
});

gitInfo.version = version;
gitInfo.buildDate = new Date();
const file = resolve(__dirname, '.', 'src', 'environments', 'version.ts');
writeFileSync(
file,
`// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!
writeFileSync(file,
`// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!
/* tslint:disable */
export const VERSION = ${JSON.stringify(gitInfo, null, 4)};
/* tslint:enable */
`,
{ encoding: 'utf-8' }
);
`, { encoding: 'utf-8' });

console.log(
`Wrote version info ${gitInfo.raw} to ${relative(
resolve(__dirname, '..'),
file
)}`
);
console.log(`Wrote version info ${gitInfo.raw} to ${relative(resolve(__dirname, '..'), file)}`);

0 comments on commit e714442

Please sign in to comment.