chore: add code formatting config and pre-commit hooks (#450)
This commit is contained in:
@@ -1,28 +1,26 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/**
|
||||
* Sync installer package.json version with main package.json
|
||||
* Used by semantic-release to keep versions in sync
|
||||
*/
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
function syncInstallerVersion() {
|
||||
// Read main package.json
|
||||
const mainPackagePath = path.join(__dirname, '..', 'package.json');
|
||||
const mainPackage = JSON.parse(fs.readFileSync(mainPackagePath, 'utf8'));
|
||||
|
||||
|
||||
// Read installer package.json
|
||||
const installerPackagePath = path.join(__dirname, 'installer', 'package.json');
|
||||
const installerPackage = JSON.parse(fs.readFileSync(installerPackagePath, 'utf8'));
|
||||
|
||||
|
||||
// Update installer version to match main version
|
||||
installerPackage.version = mainPackage.version;
|
||||
|
||||
|
||||
// Write back installer package.json
|
||||
fs.writeFileSync(installerPackagePath, JSON.stringify(installerPackage, null, 2) + '\n');
|
||||
|
||||
|
||||
console.log(`Synced installer version to ${mainPackage.version}`);
|
||||
}
|
||||
|
||||
@@ -31,4 +29,4 @@ if (require.main === module) {
|
||||
syncInstallerVersion();
|
||||
}
|
||||
|
||||
module.exports = { syncInstallerVersion };
|
||||
module.exports = { syncInstallerVersion };
|
||||
|
||||
Reference in New Issue
Block a user