[Ubuntu] Implement helper to get GitHub package download URL (#4947)

This commit is contained in:
Dibir Magomedsaygitov
2022-02-08 19:41:23 +03:00
committed by GitHub
parent cb8931646f
commit 404da76e17
14 changed files with 47 additions and 34 deletions

View File

@@ -34,8 +34,8 @@ echo "git-lfs $GIT_LFS_REPO" >> $HELPER_SCRIPTS/apt-sources.txt
#Install hub
tmp_hub="/tmp/hub"
mkdir -p "$tmp_hub"
url=$(curl -s https://api.github.com/repos/github/hub/releases/latest | jq -r '.assets[].browser_download_url | select(contains("hub-linux-amd64"))')
download_with_retries "$url" "$tmp_hub"
downloadUrl=$(get_github_package_download_url "github/hub" "contains(\"hub-linux-amd64\")")
download_with_retries "$downloadUrl" "$tmp_hub"
tar xzf "$tmp_hub"/hub-linux-amd64-*.tgz --strip-components 1 -C "$tmp_hub"
mv "$tmp_hub"/bin/hub /usr/local/bin