Files
bab-app/generate-version.cjs
Patrick Toal 67c7a3c050
Some checks failed
Build BAB Application Deployment Artifact / build (push) Failing after 1m17s
chore: Update dependencies to latest
fix: claude fixes to various errors
2026-03-15 10:41:12 -04:00

23 lines
744 B
JavaScript

const fs = require('fs');
const path = require('path');
try {
const version = process.argv[2];
if (!version) throw Error('Must pass version on command line');
// Create version content
const versionContent = `export const APP_VERSION = '${version}';\n`;
const versionTxtFilePath = path.resolve(__dirname, './VERSION');
const versionFilePath = path.resolve(__dirname, 'src/version.ts');
// Write version to TXT file
fs.writeFileSync(versionTxtFilePath, version, 'utf8');
// Write version to js file
fs.writeFileSync(versionFilePath, versionContent, 'utf8');
console.log(`Version file generated with version: ${version}`);
} catch (error) {
console.error('Error generating version file:', error);
process.exit(1);
}