1
0
Fork 0
forked from Kispi/Core
HGOE-SaS/webapp/scripts/generate-version.js

9 lines
359 B
JavaScript
Raw Normal View History

2023-07-09 19:27:45 +00:00
const fs = require('fs');
const packageJson = require('../package.json');
2023-07-09 20:45:42 +00:00
const version = `${packageJson.version}+${fs.readFileSync('../.git/refs/heads/master').toString().trim().substring(0, 7)}`;
// eslint-disable-next-line no-console
console.log(`Writing version ${version} to local .env file.`);
2023-07-09 19:27:45 +00:00
fs.writeFileSync('.env', `VITE_APP_VERSION=${version}`);