Skip to content

Instantly share code, notes, and snippets.

@FrozenCow FrozenCow/update.sh
Last active Dec 18, 2015

Embed
What would you like to do?
Update PKGBUILD with new pkgver based on Github releases
#!/bin/sh
set -o errexit
source ./PKGBUILD
OLDVERSION="$pkgver"
NEWVERSION=$(curl -sS https://api.github.com/repos/itchio/itch/releases | jq -r '.[0].tag_name | match("^v(\\d+(\\.\\d+)+)$"; "g").captures[0].string')
echo "previous version: $OLDVERSION"
echo "latest version: $NEWVERSION"
if [ "$OLDVERSION" = "$NEWVERSION" ]
then
echo "no update available"
exit 1
fi
sed -i "s/pkgver=.*/pkgver=$NEWVERSION/g" PKGBUILD
updpkgsums
namcap -i PKGBUILD
makepkg -s -f
namcap "$pkgname-$pkgver-$pkgrel-$(uname -m).pkg.tar.xz"
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
You can’t perform that action at this time.