* Sync installer package.json version with main package.json
* Used by semantic-release to keep versions in sync
*/
const fs = require('node:fs');
const path = require('node:path');
function syncInstallerVersion() {
const mainPackagePath = path.join(__dirname, '..', 'package.json');
const mainPackage = JSON.parse(fs.readFileSync(mainPackagePath, 'utf8'));
const installerPackagePath = path.join(__dirname, 'installer', 'package.json');
const installerPackage = JSON.parse(fs.readFileSync(installerPackagePath, 'utf8'));
installerPackage.version = mainPackage.version;
fs.writeFileSync(installerPackagePath, JSON.stringify(installerPackage, null, 2) + '\n');
console.log(`Synced installer version to ${mainPackage.version}`);
}
if (require.main === module) {
syncInstallerVersion();
}
module.exports = { syncInstallerVersion };