From c00d0adf4f8e77b262d40e531c3645e3ef6758b5 Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Tue, 11 Jan 2022 11:09:24 -0800 Subject: [PATCH] add terraform completion --- runcoms/zshrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runcoms/zshrc b/runcoms/zshrc index 5938076..4e63361 100644 --- a/runcoms/zshrc +++ b/runcoms/zshrc @@ -52,9 +52,10 @@ if [ -e $brew_prefix/opt/fzf/shell/completion.zsh ]; then source $brew_prefix/opt/fzf/shell/completion.zsh fi -if [ -e $brew_prefix/bin/terraform ]; then +[ -x "$(command -v kubectl)" ] && source <(kubectl completion zsh) +if [ -x "$(command -v terraform)" ]; then autoload -U +X bashcompinit && bashcompinit - complete -o nospace -C $brew_prefix/bin/terraform terraform + complete -o nospace -C /opt/homebrew/bin/terraform terraform fi if [ $commands[fzf] ]; then @@ -154,4 +155,3 @@ if [ $commands[exa] ]; then fi [[ -s "$HOME/.zshrc.local" ]] && . "$HOME/.zshrc.local" -