From ec43ba2b17fc942942cc5e4a37d52b0f78ddab3f Mon Sep 17 00:00:00 2001 From: TBK Date: Sat, 8 Oct 2022 10:43:57 +0200 Subject: [PATCH] Add upd.sh Script the automates most of the update process. --- upd.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 upd.sh diff --git a/upd.sh b/upd.sh new file mode 100755 index 0000000..18147d7 --- /dev/null +++ b/upd.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +# Get new version info +URL=$(curl -H 'X-Ubuntu-Series: 16' https://api.snapcraft.io/api/v1/snaps/details/termius-beta | jq '.download_url' -r | cut -d "_" -f2) +VER=$(curl -H 'X-Ubuntu-Series: 16' https://api.snapcraft.io/api/v1/snaps/details/termius-beta | jq '.version' -r) + +# Update PKGBUILD +sed -i "s/_[0-9]\+.snap/_$URL/g" PKGBUILD +sed -i "s/pkgver=.*$/pkgver=$VER/g" PKGBUILD + +# Calc new hash +updpkgsums + +# Build & install pkg +makepkg -si + +# Update .SRCINFO +makepkg --printsrcinfo > .SRCINFO + +# Git ops +git add .SRCINFO PKGBUILD +git commit -m "Update to $VER" + +# CLeanup +rm -rf pkg/ src/ *.snap *.pkg.tar.zst + +printf "\nAll done!\nRemember to git push!\n"