From 053476eee2a8ee0bc75fa8e209e414f6e32d5d52 Mon Sep 17 00:00:00 2001 From: Paolo Mainardi Date: Fri, 28 Aug 2020 17:49:24 +0200 Subject: [PATCH] Install hub without snap --- images/linux/scripts/installers/git.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/images/linux/scripts/installers/git.sh b/images/linux/scripts/installers/git.sh index e2b27429a..aa1f0f1a0 100644 --- a/images/linux/scripts/installers/git.sh +++ b/images/linux/scripts/installers/git.sh @@ -5,7 +5,7 @@ ################################################################################ # Source the helpers for use with the script -source $HELPER_SCRIPTS/document.sh +source "$HELPER_SCRIPTS"/document.sh ## Install git add-apt-repository ppa:git-core/ppa -y @@ -46,7 +46,15 @@ DocumentInstalledItem "Git Large File Storage (LFS) ($(git-lfs --version 2>&1 | DocumentInstalledItem "Git-ftp ($(git-ftp --version | cut -d ' ' -f 3))" #Install hub -snap install hub --classic +TEMP_HUB=$(mktemp -d -t) +pushd "$TEMP_HUB" || exit +URL=$(curl -s https://api.github.com/repos/github/hub/releases/latest | jq -r '.assets[].browser_download_url | select(contains("hub-linux-amd64"))') +wget -P "$TEMP_HUB" "$URL" +tar xzvf "$TEMP_HUB"/hub-linux-amd64-*.tgz --strip-components 1 +mv bin/hub /usr/local/bin +rm -rf "$TEMP_HUB" +popd || exit + if command -v hub; then echo "hub CLI was installed successfully" DocumentInstalledItem "Hub CLI ($(hub --version | grep "hub version" | cut -d ' ' -f 3))"