File updater.sh of Package anki

#!/usr/bin/env bash
cd /home/qydw/osc/home:fusionfuture:anki/anki
osc update
LATEST_ANKI_VERSION=$(curl -s https://api.github.com/repos/ankitects/anki/releases|jq -cr .[0].tag_name 2>/dev/null)
LAST_CHECKED_VERSION=$(cat LATEST_ANKI_VERSION)
[ -z "${LATEST_ANKI_VERSION}" ] && exit
[ "${LATEST_ANKI_VERSION}" = "${LAST_CHECKED_VERSION}" ] && exit || echo "New version found"
sed -i -E "s/download\/.+?\/anki-.+?\.tar.zst/download\/${LATEST_ANKI_VERSION}\/anki-${LATEST_ANKI_VERSION}-linux-qt6.tar.zst/" _service
sed -i -E "s/^%define program_version .+$/%define program_version ${LATEST_ANKI_VERSION}/" anki.spec
osc vc -m "Update to ${LATEST_ANKI_VERSION}" && \
osc ci -m "Update to ${LATEST_ANKI_VERSION}" && \
echo -n ${LATEST_ANKI_VERSION} > LATEST_ANKI_VERSION
openSUSE Build Service is sponsored by