K9s: Add latest version point always to latest release archive

Created on 15 Jan 2020  路  1Comment  路  Source: derailed/k9s

K9S is released very often. It would be nice if release contains a static symbolic link to "latest" release:

For example:

https://github.com/derailed/k9s/releases/download/latest/k9s_latest_Linux_x86_64.tar.gz
would currently point or redirect, download:
https://github.com/derailed/k9s/releases/download/0.12.0/k9s_0.12.0_Linux_x86_64.tar.gz

enhancement

Most helpful comment

Maybe helpful for anybody having the same question. For myself i'm doing it like this for now:

#!/bin/bash

# set some variables depending on your system
OUTPUT_PATH=/tmp
OUTPUT_NAME=$OUTPUT_PATH/k9s.tar.gz
BIN_PATH=/home/mralexandernickel/bin
BIN_NAME=k9s

# download, untar, cleanup and move
/usr/bin/curl -s -L $(/usr/bin/curl -s https://api.github.com/repos/derailed/k9s/releases/latest|/usr/bin/jq -r '.assets | map(select(.name | contains("Linux_x86_64"))) | .[0].browser_download_url') -o $OUTPUT_NAME
cd $OUTPUT_PATH
/usr/bin/tar xzf $OUTPUT_NAME
/usr/bin/rm $OUTPUT_NAME
/usr/bin/mv $BIN_NAME $BIN_PATH/$BIN_NAME

...if you want download something else than linux-64bit, you'd need to edit the "contains"-part of jq command.

>All comments

Maybe helpful for anybody having the same question. For myself i'm doing it like this for now:

#!/bin/bash

# set some variables depending on your system
OUTPUT_PATH=/tmp
OUTPUT_NAME=$OUTPUT_PATH/k9s.tar.gz
BIN_PATH=/home/mralexandernickel/bin
BIN_NAME=k9s

# download, untar, cleanup and move
/usr/bin/curl -s -L $(/usr/bin/curl -s https://api.github.com/repos/derailed/k9s/releases/latest|/usr/bin/jq -r '.assets | map(select(.name | contains("Linux_x86_64"))) | .[0].browser_download_url') -o $OUTPUT_NAME
cd $OUTPUT_PATH
/usr/bin/tar xzf $OUTPUT_NAME
/usr/bin/rm $OUTPUT_NAME
/usr/bin/mv $BIN_NAME $BIN_PATH/$BIN_NAME

...if you want download something else than linux-64bit, you'd need to edit the "contains"-part of jq command.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rahilb picture rahilb  路  3Comments

ChrisCooney picture ChrisCooney  路  3Comments

cdunford picture cdunford  路  3Comments

pgoodjohn picture pgoodjohn  路  4Comments

RothAndrew picture RothAndrew  路  3Comments