From 4a7a9823dfa9ff9884f8e164d6879e682ce68a9f Mon Sep 17 00:00:00 2001 From: Ivan Charapanau Date: Fri, 27 Sep 2024 20:56:39 +0200 Subject: [PATCH] fix: macos install/update compat --- harbor.sh | 3 ++- install.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/harbor.sh b/harbor.sh index d9aef15..baa6557 100755 --- a/harbor.sh +++ b/harbor.sh @@ -1644,7 +1644,7 @@ unsafe_update() { } resolve_harbor_version() { - git ls-remote --tags "$harbor_repo_url" | grep -o "v.*" | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n | head -n 1 + curl -s "$harbor_release_url" | sed -n 's/.*"tag_name": "\(.*\)".*/\1/p' } update_harbor() { @@ -3307,6 +3307,7 @@ run_stt_command() { # Globals version="0.1.31" harbor_repo_url="https://github.com/av/harbor.git" +harbor_release_url="https://api.github.com/repos/av/harbor/releases/latest" delimiter="|" scramble_exit_code=42 harbor_home=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") diff --git a/install.sh b/install.sh index 3a57995..47e19b3 100755 --- a/install.sh +++ b/install.sh @@ -9,12 +9,13 @@ set -e HARBOR_INSTALL_PATH="${HOME}/.harbor" HARBOR_REPO_URL="https://github.com/av/harbor.git" +HARBOR_RELEASE_URL="https://api.github.com/repos/av/harbor/releases/latest" HARBOR_VERSION="" # ======================================== resolve_harbor_version() { - git ls-remote --tags "$HARBOR_REPO_URL" | grep -o "v.*" | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n | head -n 1 + curl -s "$HARBOR_RELEASE_URL" | sed -n 's/.*"tag_name": "\(.*\)".*/\1/p' } check_dependencies() {