From 667914aecfe7dd43998bdd74dad5a343f671d4d0 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Tue, 10 Feb 2026 13:45:18 +0200 Subject: [PATCH] Support installing a specific project release --- .local/bin/ghup | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.local/bin/ghup b/.local/bin/ghup index ad0e14f..e373522 100755 --- a/.local/bin/ghup +++ b/.local/bin/ghup @@ -11,16 +11,24 @@ github_update() { repo="$2" resource_selector="$3" post_fetch="$4" + override_tag="${5:-}" - response=$(curl --silent "https://api.github.com/repos/${repo}/releases/latest") - latest_version=$(printf '%s' "${response}" | jq --raw-output .name) + if [ -z "${override_tag}" ]; then + response=$(curl --silent "https://api.github.com/repos/${repo}/releases/latest") + latest_version=$(printf '%s' "${response}" | jq --raw-output .name) + version_type="Latest version" + else + response=$(curl --silent "https://api.github.com/repos/${repo}/releases/tags/${override_tag}") + latest_version="${override_tag}" + version_type="Fixed version" + fi VERSION_FILE="${STATE_DIR}/${package}" install="false" if [ -f "${VERSION_FILE}" ]; then installed_version=$(cat "${VERSION_FILE}") if [ "${installed_version}" = "${latest_version}" ]; then - echo "Latest version \"${package} ${installed_version}\" is already installed" + echo "${version_type} \"${package} ${installed_version}\" is already installed" else echo "Upgrading \"${package} ${installed_version}\" -> \"${package} ${latest_version}\"..." install="true"