-
-
Save khbecker/fa48b29aeb523f0a0689 to your computer and use it in GitHub Desktop.
Update PKGBUILD for itch with new pkgver based on Github releases
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# update-itch.sh | |
# | |
# Required packages: jq and pkgbuild-introspection | |
source ./PKGBUILD | |
OLDVERSION="$pkgver" | |
echo "Old Version: ${OLDVERSION}" | |
NEWVERSION=$(curl https://api.github.com/repos/itchio/itch/releases 2> /dev/null | jq -r '.[0].tag_name | match("\\d(\\.\\d+)+").string') | |
echo "New Version: ${NEWVERSION}" | |
if [ "$OLDVERSION" = "$NEWVERSION" ]; then | |
echo "No update available, exiting..." | |
exit 1 | |
fi | |
sed -i "s/pkgver=.*/pkgver=${NEWVERSION}/g" PKGBUILD | |
makepkg -s -f --skipinteg | |
# Uncomment the lines below if you want to make and commit a SRCINFO file | |
# mksrcinfo | |
# git add PKGBUILD .SRCINFO | |
# git commit -m "$OLDVERSION -> $NEWVERSION" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment