From 27d5901276111be89550442298380a51e2b7cd9c Mon Sep 17 00:00:00 2001 From: Thomas Johansen Date: Mon, 20 Jul 2020 13:41:23 +0200 Subject: [PATCH] feat: update install script to target Go releases --- docs/install.sh | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/docs/install.sh b/docs/install.sh index 341489e..91d67ec 100644 --- a/docs/install.sh +++ b/docs/install.sh @@ -3,12 +3,20 @@ set -eu umask 077 +kernel="$(uname -s | tr '[:upper:]' '[:lower:]')" +case "${kernel}" in + linux*) os="linux" ;; + darwin*) os="macos" ;; + *) echo "unknown kernel" && exit 1 ;; +esac + api_url="https://raw.githubusercontent.com/uitml/frink/legacy" +version="$(curl -s https://api.github.com/repos/uitml/frink/releases/latest | grep "\"name\": \"v.*\"" | cut -d '"' -f 4)" +download_url="https://github.com/uitml/frink/releases/download/${version}/frink-${os}" + +echo ${download_url} -mkdir -p /tmp/frink && cd /tmp/frink -curl -LO "${api_url}/bin/kubectl-job-kill" -curl -LO "${api_url}/bin/kubectl-job-list" -curl -LO "${api_url}/bin/kubectl-job-run" -curl -LO "${api_url}/bin/kubectl-job-watch" -sudo cp kubectl* /usr/local/bin/ -sudo chmod 755 /usr/local/bin/kubectl-job-* +cd "$(mktemp -d -t frink-XXXX)" +curl -LO "${download_url}" +sudo cp frink* /usr/local/bin/frink +sudo chmod 755 /usr/local/bin/frink