fix(auto-update): enable auto update for `mangohud`

This commit is contained in:
MedzikUser 2022-05-21 12:01:49 +02:00
parent 0a7e304b8f
commit 9de46f0e62
No known key found for this signature in database
GPG Key ID: A5FAC1E185C112DB
3 changed files with 12 additions and 3 deletions

View File

@ -1,2 +1,3 @@
AUR_NAME="mangohud"
AUR_UPDATED="null"
AUR_PKGBASE=true
AUR_UPDATED="24f171aa7a3a8ac97a601c990d45e12b2e33cf66"

View File

@ -25,9 +25,16 @@ update-package() {
then
if [ -n "${AUR_NAME}" ]
then
if [ -n "${AUR_PKGBASE}" ]
then
local latest_version="latest"
local last_updated="$(git ls-remote --quiet https://aur.archlinux.org/${AUR_NAME}.git refs/heads/master | awk '{print $1}')"
else
local latest_version="$(curl --location --silent "https://aur.archlinux.org/rpc/?v=5&type=info&arg=${AUR_NAME}" | jq -r '.results[0].Version')"
local last_updated="$(curl --location --silent "https://aur.archlinux.org/rpc/?v=5&type=info&arg=${AUR_NAME}" | jq -r '.results[0].LastModified')"
fi
local version="${AUR_UPDATED}"
local latest_version="$(curl --location --silent "https://aur.archlinux.org/rpc/?v=5&type=info&arg=${AUR_NAME}" | jq -r '.results[0].Version')"
local last_updated="$(curl --location --silent "https://aur.archlinux.org/rpc/?v=5&type=info&arg=${AUR_NAME}" | jq -r '.results[0].LastModified')"
if [[ -z "${last_updated}" || "${last_updated}" = "null" ]]
then

View File

@ -4,6 +4,7 @@ parse-conf() {
. "${1}/built.conf"
echo "local AUR_NAME=${AUR_NAME}"
echo "local AUR_PKGBASE=${AUR_PKGBASE}"
echo "local AUR_UPDATED=${AUR_UPDATED}"
echo "local GITHUB_REPO=${GITHUB_REPO}"
echo "local GITHUB_TAG=${GITHUB_TAG}"