diff --git a/.installer/packages b/.installer/packages index 4a1a0f3..348144c 100644 --- a/.installer/packages +++ b/.installer/packages @@ -13,3 +13,5 @@ apt-laptop:brightnessctl apt-any:libxcb-render0-dev,libffi-dev,python3-dev,python3-cffi pip-any:flashfocus + +krew-any:ctx,krew,ns,slice,stern,tree diff --git a/setup_system.sh b/setup_system.sh index 035ec40..9939063 100755 --- a/setup_system.sh +++ b/setup_system.sh @@ -130,6 +130,30 @@ function install_picom() { rm -Rf "$tmp" } +function setup_krew_plugins() { + local targets=("krew-any") packages + + if ! command -v kubectl-krew >/dev/null; then + echo "WARN: Krew not installed: kubectl-krew" + return 1 + fi + + for package in $(get_packages "${targets[@]}"); do + if kubectl-krew list | grep -q "^$package$" >/dev/null; then + if $UPGRADE_PACKAGES; then + echo "Package '$package' will be upgraded." + else + echo "Package '$package' already exists." + continue + fi + else + echo "Package '$package' will be installed." + fi + + kubectl-krew install "$package" || return 2 + done +} + # # Setup for Arch-like systems # @@ -183,6 +207,7 @@ function setup_arch() { setup_arch_with_pip || return 4 configure_sddm || return 5 configure_ufw || return 6 + setup_krew_plugins || return 7 } # @@ -238,6 +263,7 @@ function setup_debian() { setup_debian_with_git || return 4 configure_sddm || return 5 configure_ufw || return 6 + setup_krew_plugins || return 7 } ID_LIKE="$(grep ID_LIKE=