feat(scripts): 2 new scripts for the build process

This commit is contained in:
2025-07-16 08:37:25 -05:00
parent a0856d171a
commit afe795edd5
2 changed files with 66 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
/**
* This is for release-it to be able to post the new build number in the releases
*/
import fs from "fs-extra";
import path from "path";
import { fileURLToPath } from "url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
async function readBuildNumber() {
try {
const buildNumberPath = path.resolve(__dirname, "../BUILD_NUMBER");
const buildNumber = (await fs.readFile(buildNumberPath, "utf8")).trim();
process.env.BUILD_NUMBER = buildNumber;
console.log(`Build number: ${buildNumber}`);
} catch (error) {
console.error("Error reading BUILD_NUMBER:", error);
process.exit(1);
}
}
readBuildNumber();