From 7037c6a791211c1fb03ff137761352997e48c1c2 Mon Sep 17 00:00:00 2001 From: david Date: Thu, 11 Aug 2022 23:08:25 +0200 Subject: [PATCH] Feature: Manual and auto classpath option - Making download url static in install file --- install | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/install b/install index 8019de4..5979401 100755 --- a/install +++ b/install @@ -12,7 +12,9 @@ function fail() { # platform IDs LIN=linux +LIN_URL=https://git.kirby-link.dd-dns.de/attachments/f701fbff-c58b-4aac-91e3-47efda1fc760 MAC=macos +MAC_URL=https://git.kirby-link.dd-dns.de/attachments/b09c6469-406a-4dd1-b5e8-1294a3aabf0f WIN=windows # returns this platform ID @@ -32,20 +34,14 @@ function get_this_platform() { THIS_PLATFORM=$(get_this_platform) # fetches latest release download link for the platform -function get_latest_warp_link() { +function get_warp_link() { local this_platform=$1 - local info - info=$(curl -fsSL https://git.kirby-link.dd-dns.de/api/v1/repos/public/warp/releases) - if [[ $? != 0 ]]; then - echo "Error: Failed to get information about releases" >&2 - fail - fi - echo "$info" \ - | grep "browser_download_url" \ - | grep "$this_platform-x64.warp-packer" \ - | head -n 1 \ - | awk '{print $2}' \ - | sed -e 's/"//g' + + if [ "$this_platform" = "$LIN" ]; then + echo "$LIN_URL" + else + echo "$MAC_URL" + fi } # downloads and installs single binary @@ -94,7 +90,7 @@ function get_missing_deps() { WARP4J_LINK="https://git.kirby-link.dd-dns.de/public/warp4j/raw/branch/feature/manual_and_auto_classpath_option/warp4j" echo "Getting information about warp-packer releases..." -WARP_LINK=$(get_latest_warp_link $THIS_PLATFORM) +WARP_LINK=$(get_warp_link $THIS_PLATFORM) MISSING_DEPS=$(get_missing_deps)