Skip to content

Commit 9ebfd53

Browse files
author
Ira Abramov
committed
auto-compat with OpenTofu, and co-pilot suggested a few more aliases. hmm.
1 parent 99c680b commit 9ebfd53

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed
Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
# shellcheck shell=bash
2-
about-alias 'Aliases for Terraform and Terragrunt'
2+
about-alias 'Aliases for Terraform/OpenTofu and Terragrunt'
33

4-
alias tf='terraform'
5-
alias tfi='tf init'
6-
alias tfv='terraform validate'
7-
alias tfp='terraform plan'
8-
alias tfa='terraform apply'
9-
alias tfd='terraform destroy'
10-
alias tfw='terraform workspace'
4+
if _command_exists terraform; then
5+
alias tf='terraform'
6+
elif _command_exists tofu; then
7+
alias tf='tofu'
8+
fi
9+
10+
if _command_exists tf; then
11+
alias tfa='tf apply'
12+
alias tfp='tf plan'
13+
alias tfd='tf destroy'
14+
alias tfv='tf validate'
15+
alias tfi='tf init'
16+
alias tfo='tf output'
17+
alias tfr='tf refresh'
18+
alias tfw='tf workspace'
19+
alias tfae='tf apply -auto-approve'
20+
alias tfpa='tf plan -out=tfplan && tf apply tfplan'
21+
alias tfpaf='tf plan -out=tfplan && tf apply -auto-approve tfplan'
22+
fi

0 commit comments

Comments
 (0)