From e12fdf8f8f8a920aa24adb33f8753278f8292d90 Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Thu, 23 Oct 2025 12:45:09 -0300 Subject: [PATCH] remove js script --- .github/workflows/update-aur.yml | 15 ++++++++++++++- scripts/update-pkgver.js | 32 -------------------------------- 2 files changed, 14 insertions(+), 33 deletions(-) delete mode 100755 scripts/update-pkgver.js diff --git a/.github/workflows/update-aur.yml b/.github/workflows/update-aur.yml index 575b6e13..4382d7da 100644 --- a/.github/workflows/update-aur.yml +++ b/.github/workflows/update-aur.yml @@ -85,7 +85,20 @@ jobs: - name: Update PKGBUILD and .SRCINFO if: steps.check-update.outputs.update_needed == 'true' run: | - node ../scripts/update-pkgver.js "${{ steps.get-version.outputs.version }}" ./PKGBUILD + # Update pkgver in PKGBUILD + NEW_VERSION="${{ steps.get-version.outputs.version }}" + + echo "Updating PKGBUILD pkgver to $NEW_VERSION" + + # Read PKGBUILD and update pkgver line + sed -i "s/^pkgver=.*/pkgver=$NEW_VERSION/" ./PKGBUILD + + # Reset pkgrel to 1 when version changes + sed -i "s/^pkgrel=.*/pkgrel=1/" "$PKGBUILD_PATH" + + echo "✅ Successfully updated pkgver to $NEW_VERSION in $PKGBUILD_PATH" + + # Update package checksums and generate .SRCINFO updpkgsums makepkg --printsrcinfo > .SRCINFO diff --git a/scripts/update-pkgver.js b/scripts/update-pkgver.js deleted file mode 100755 index 41d87f0b..00000000 --- a/scripts/update-pkgver.js +++ /dev/null @@ -1,32 +0,0 @@ -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);