termux-packages/scripts/updates/internal/termux_github_auto_update.sh
Aditya Alok d67a38d324
refactor(auto-update): clean up some code
- move epoch addition to termux_pkg_upgrade_version set.
- now termux_pkg_upgrade_version can be given retrived version/tag from
  api, directly.

Signed-off-by: Aditya Alok <dev.aditya.alok@gmail.com>
2022-04-05 11:21:14 +05:30

14 lines
395 B
Bash

# shellcheck shell=bash
# Default algorithm to use for packages hosted on github.com
termux_github_auto_update() {
local latest_tag
latest_tag="$(
termux_github_api_get_tag "${TERMUX_PKG_SRCURL}" "${TERMUX_PKG_UPDATE_TAG_TYPE}"
)"
if [[ -z "${latest_tag}" ]]; then
termux_error_exit "ERROR: Unable to get tag from ${TERMUX_PKG_SRCURL}"
fi
termux_pkg_upgrade_version "${latest_tag}"
}