Install krew

This commit is contained in:
dabruh 2022-12-14 09:41:02 +01:00
parent a5db9cdc9a
commit efb6243145
1 changed files with 18 additions and 4 deletions

View File

@ -169,6 +169,18 @@ function setup_brew_formulas() {
done
}
function setup_krew() {
set -x
cd "$(mktemp -d)" &&
OS="$(uname | tr '[:upper:]' '[:lower:]')" &&
ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" &&
KREW="krew-${OS}_${ARCH}" &&
curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" &&
tar zxvf "${KREW}.tar.gz" &&
./"${KREW}" install krew
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
}
function setup_krew_plugins() {
local targets=("krew-any") packages
@ -231,7 +243,7 @@ function setup_arch_with_yay() {
done
}
function setup_arch_with_pip(){
function setup_arch_with_pip() {
local targets=("pip-any") packages
packages="$(get_packages "${targets[@]}")"
@ -248,7 +260,8 @@ function setup_arch() {
configure_ufw || return 6
setup_homebrew || return 7
setup_brew_formulas || return 8
setup_krew_plugins || return 9
setup_krew || return 9
setup_krew_plugins || return 10
}
#
@ -281,7 +294,7 @@ function setup_debian_with_apt() {
sudo apt-get install $packages -y || return 2
}
function setup_debian_with_pip(){
function setup_debian_with_pip() {
local targets=("pip-any") packages
packages="$(get_packages "${targets[@]}")"
@ -303,7 +316,8 @@ function setup_debian() {
configure_ufw || return 6
setup_homebrew || return 7
setup_brew_formulas || return 8
setup_krew_plugins || return 9
setup_krew || return 9
setup_krew_plugins || return 10
}
ID_LIKE="$(grep ID_LIKE= </etc/os-release | cut -d= -f2)"