chore: improve completion setup
This commit is contained in:
parent
f9f0934339
commit
aacef103a3
@ -10,38 +10,23 @@ if [ ! -d ${LOCAL_SRC_HOME}/elixir-ls/release ]; then
|
||||
fi
|
||||
|
||||
# NOTE: (jpd) create auto-completion
|
||||
# TODO: (jpd) check a way to create a list and loop to create these completions
|
||||
if [ ! -d ${XDG_CONFIG_HOME}/fish/completions/kubectl.fish ]; then
|
||||
echo "setup kubectl completion"
|
||||
kubectl completion fish > ${XDG_CONFIG_HOME}/fish/completions/kubectl.fish
|
||||
fi
|
||||
if [ ! -d ${XDG_CONFIG_HOME}/fish/completions/kind.fish ]; then
|
||||
echo "setup kind completion"
|
||||
kind completion fish > ${XDG_CONFIG_HOME}/fish/completions/kind.fish
|
||||
fi
|
||||
if [ ! -d ${XDG_CONFIG_HOME}/fish/completions/k3d.fish ]; then
|
||||
echo "setup k3d completion"
|
||||
k3d completion fish > ${XDG_CONFIG_HOME}/fish/completions/k3d.fish
|
||||
fi
|
||||
if [ ! -d ${XDG_CONFIG_HOME}/fish/completions/helm.fish ]; then
|
||||
echo "setup helm completion"
|
||||
helm completion fish > ${XDG_CONFIG_HOME}/fish/completions/helm.fish
|
||||
fi
|
||||
if [ ! -d ${XDG_CONFIG_HOME}/fish/completions/ctlptl.fish ]; then
|
||||
echo "setup ctlptl completion"
|
||||
ctlptl completion fish > ~/.config/fish/completions/ctlptl.fish
|
||||
fi
|
||||
if [ ! -d ${XDG_CONFIG_HOME}/fish/completions/eksctl.fish ]; then
|
||||
echo "setup eksctl completion"
|
||||
eksctl completion fish > ~/.config/fish/completions/eksctl.fish
|
||||
fi
|
||||
if [ ! -d ${XDG_CONFIG_HOME}/fish/completions/k9s.fish ]; then
|
||||
echo "setup k9s completion"
|
||||
k9s completion fish > ~/.config/fish/completions/k9s.fish
|
||||
fi
|
||||
if [ ! -d ${XDG_CONFIG_HOME}/fish/completions/lefthook.fish ]; then
|
||||
echo "setup lefthook completion"
|
||||
lefthook completion fish > ~/.config/fish/completions/lefthook.fish
|
||||
fi
|
||||
commands=(
|
||||
"ctlptl"
|
||||
"eksctl"
|
||||
"helm"
|
||||
"k3d"
|
||||
"k9s"
|
||||
"kind"
|
||||
"kubectl"
|
||||
"lefthook"
|
||||
)
|
||||
echo "create completion for ${commands[@]}"
|
||||
for cmd in ${commands[@]}; do
|
||||
completion_dir=${XDG_CONFIG_HOME}/fish/completions/${cmd}.fish
|
||||
if [ ! -f ${completion_dir} ]; then
|
||||
echo "setup ${cmd} completion"
|
||||
echo $(${cmd} completion fish) > ${completion_dir}
|
||||
fi
|
||||
done
|
||||
|
||||
exec "$@"
|
||||
|
Loading…
x
Reference in New Issue
Block a user