From d7df6c9d526d2ff24f3cd236f5d6c3a4344945f8 Mon Sep 17 00:00:00 2001 From: Adar Nimrod <nimrod@shore.co.il> Date: Wed, 28 Feb 2024 20:30:04 +0200 Subject: [PATCH] Some Terraform tweaks. --- .bash_completion.d/tf | 2 +- .bashrc.d/terraform | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/.bash_completion.d/tf b/.bash_completion.d/tf index 3d1cd0c..1a7967a 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 31eec50..7e70f5f 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 "$@" } -- GitLab