diff --git a/.bash_completion.d/tf b/.bash_completion.d/tf index 3d1cd0c116efa2a7b92d42bd67f7e59336c6999e..1a7967a9365a5967ba34def5213e1f70c7de6404 100644 --- a/.bash_completion.d/tf +++ b/.bash_completion.d/tf @@ -1,3 +1,3 @@ # vim: ft=bash -complete -C terraform tf +complete -C tofu tf diff --git a/.bashrc.d/terraform b/.bashrc.d/terraform index 31eec501a02dadd2590d89580c4534f6bdb56b75..7e70f5fe22e339c886d35bfdb934540f330d44a9 100644 --- a/.bashrc.d/terraform +++ b/.bashrc.d/terraform @@ -10,16 +10,8 @@ alias tfp='tf init -backend=false && tf plan -out tfplan' alias tfr='tf apply -auto-approve -refresh-only' alias tfvf='tf init -backend=false && tf validate && tf fmt -diff' -tfp-next () { +tf-next () { current="$(tf workspace show)" next="$(tf workspace list | cut -c3- | grep --line-regexp --after-context=1 "$current" | tail +2)" - tf apply tfplan - tf apply -auto-approve -refresh-only - if [ -z "$next" ] - then - red "Last workspace in the cycle." - return - fi tf workspace select "$next" - tf plan -out tfplan "$@" }