Skip to content

Instantly share code, notes, and snippets.

View reschenburgIDBS's full-sized avatar

Roland Eschenburg reschenburgIDBS

View GitHub Profile
@reschenburgIDBS
reschenburgIDBS / .bashrc
Last active October 2, 2020 12:44
version switcher for kubectl, kops, helm and terraform - requires https://github.com/junegunn/fzf
function versionswitcher {
local BINARY="$1"
local URL="$2" #must contain 'VERSION' in it somewhere to enable download of different versions
local CACHE="${HOME}/.${BINARY}.versions"
local DSTFILE="/usr/local/bin/${BINARY}"
local TEMPDIR="${CACHE}/tmp"
mkdir -p "$CACHE"
if [[ ! "$3" ]]; then