Add recursive tf init function
This commit is contained in:
parent
d7d2b7cb1f
commit
6564c857cf
11
zsh/.zshrc
11
zsh/.zshrc
@ -272,3 +272,14 @@ PROMPT=$PROMPT'%{$(vterm_prompt_end)%}'
|
|||||||
type navi > /dev/null && eval "$(navi widget zsh)"
|
type navi > /dev/null && eval "$(navi widget zsh)"
|
||||||
|
|
||||||
eval "$(rbenv init - zsh)"
|
eval "$(rbenv init - zsh)"
|
||||||
|
|
||||||
|
tf-init-recursive() {
|
||||||
|
here=$(pwd)
|
||||||
|
dirs=$(find . -type f -name '*.tf' -exec dirname {} \; | sort | uniq | xargs readlink --canonicalize)
|
||||||
|
echo $dirs | while read -r dir; do
|
||||||
|
echo "Initializing Terraform in $dir"
|
||||||
|
cd $dir
|
||||||
|
terraform init || break
|
||||||
|
done
|
||||||
|
cd $here
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user