aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorTBK2022-10-08 10:38:01 +0200
committerTBK2022-10-08 10:38:34 +0200
commitefdef40dc4d7bc8ff0215303da57ff8ee9055123 (patch)
tree1a9d617b2c68966ae414433299d298ff3bbdbfd1
parentc2503421b3a35cfb36951570b800c562bfab669f (diff)
downloadaur-efdef40dc4d7bc8ff0215303da57ff8ee9055123.tar.gz
Add upd.sh
Script the automates most of the update process.
-rwxr-xr-xupd.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/upd.sh b/upd.sh
new file mode 100755
index 000000000000..173dfec86c54
--- /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-app | jq '.download_url' -r| cut -d "_" -f2)
+VER=$(curl -H 'X-Ubuntu-Series: 16' https://api.snapcraft.io/api/v1/snaps/details/termius-app | 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"