Feature: Manual and auto classpath option

- Making download url static in install file
This commit is contained in:
david 2022-08-11 23:08:25 +02:00
parent 81dd7332c7
commit 7037c6a791

24
install
View File

@ -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)