chore: action to update aur

This commit is contained in:
Zamitto
2025-10-23 09:49:07 -03:00
parent 214e8f9538
commit 9a278dc614
2 changed files with 152 additions and 0 deletions

32
scripts/update-pkgver.js Executable file
View File

@@ -0,0 +1,32 @@
const fs = require("node:fs");
function updatePkgver(newVersion, pkgbuildPath) {
try {
const content = fs.readFileSync(pkgbuildPath, "utf8");
const lines = content.split("\n");
const updatedLines = lines.map((line) => {
if (line.trim().startsWith("pkgver=")) {
return `pkgver=${newVersion}`;
}
return line;
});
fs.writeFileSync(pkgbuildPath, updatedLines.join("\n"), "utf8");
console.log(
`✅ Successfully updated pkgver to ${newVersion} in ${pkgbuildPath}`
);
} catch (error) {
console.error(`❌ Error updating pkgver: ${error.message}`);
process.exit(1);
}
}
// Get version from command line arguments
const args = process.argv.slice(2);
const newVersion = args[0];
const pkgbuildPath = args[1] || "./PKGBUILD";
updatePkgver(newVersion, pkgbuildPath);