Files

23 lines
778 B
JavaScript

import { readFileSync, writeFileSync } from 'fs';
import { join, dirname } from 'path';
import { fileURLToPath } from 'url';
const __dirname = dirname(fileURLToPath(import.meta.url));
const versionFile = join(__dirname, 'frontend/src/constants.ts');
try {
const content = readFileSync(versionFile, 'utf8');
const versionMatch = content.match(/V(\d+)\.(\d+)\.(\d+)/);
if (versionMatch) {
let [full, major, minor, patch] = versionMatch;
patch = parseInt(patch) + 1;
const newVersion = `V${major}.${minor}.${patch}`;
const newContent = content.replace(/V\d+\.\d+\.\d+/, newVersion);
writeFileSync(versionFile, newContent);
console.log(`Version bumped to ${newVersion}`);
}
} catch (e) {
console.error('Error updating version:', e.message);
}