From b246e7dc4403d17877c5b3ac4f8ba529e68f3a49 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Sat, 10 Oct 2020 14:50:55 +0800 Subject: [PATCH] [feature] install kubectl and its fish completion --- apps/k8s.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 apps/k8s.sh diff --git a/apps/k8s.sh b/apps/k8s.sh new file mode 100755 index 0000000..27c7a3e --- /dev/null +++ b/apps/k8s.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +DIR=$(readlink -f $(dirname $0)) +. $DIR/../env.sh + + +# install docker +case "$PM" in + apt) + #sudo snap install kubectl --classic + ;; + pacman) + # TODO + ;; +esac + +# completion for fish +case "$DEFAULT_SHELL" in + "$FISH") + [[ ! -f $HOME/.config/fish/completions/docker.fish ]] && \ + curl -Lo $HOME/.config/fish/completions/docker.fish --create-dirs \ + 'https://github.com/docker/cli/raw/master/contrib/completion/fish/docker.fish' + fish -c "fisher add evanlucas/fish-kubectl-completions" + ;; +esac