HEX
Server: Apache
System: Linux efa57bbe-abb1-400d-2985-3b056fbc2701.secureserver.net 6.1.147-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jul 24 12:33:32 EDT 2025 x86_64
User: root (0)
PHP: 8.0.30.4
Disabled: NONE
Upload Files
File: //var/www/wp-content/mu-plugins/vendor/wpex/godaddy-launch/.dev/bin/update-version.js
const fs = require('fs').promises;
const path = require('path');
const packageJson = require('../../package.json');

const filesToUpdate = [
	{
		filePath: 'godaddy-launch.php',
		searchPattern: /Version.*/,
		replacePattern: `Version: ${packageJson.version}`,
	},
    {
		filePath: 'includes/Application.php',
		searchPattern: /const VERSION.*/,
		replacePattern: `const VERSION = '${packageJson.version}';`,
	},
];

async function updateVersionInFiles() {
	for (const file of filesToUpdate) {
		try {
			const filePath = path.join(__dirname, '..', '..', file.filePath);
			const data = await fs.readFile(filePath, 'utf8');

			const updatedData = data.replace(file.searchPattern, file.replacePattern);

			await fs.writeFile(filePath, updatedData, 'utf8');
			console.log(`Updated version in ${file.filePath}`);
		} catch (error) {
			console.error(`Error updating ${file.filePath}: ${error.message}`);
		}
	}
}

updateVersionInFiles().then(() => {
	console.log('Version update process completed.');
}).catch(error => {
	console.error(`An error occurred: ${error.message}`);
});