Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Create TFENV_TF_VERSION #405

Open
bytebeast opened this issue Jul 28, 2023 · 2 comments
Open

Feature Request: Create TFENV_TF_VERSION #405

bytebeast opened this issue Jul 28, 2023 · 2 comments

Comments

@bytebeast
Copy link

Feature Request:

Create TFENV_TF_VERSION variable that has current selected version. So that I may use that in my prompt.

Thanks.

@next-jesusmanuelnavarro

Wouldn't terraform --version itself suffice? i.e.:

$ terraform --version --json | jq -r .terraform_version
1.5.5
$

Note that tfenv is meant to "dynamically" load Terraform, so it may happen that no terraform at all is activated at any given prompt, i.e.:

$ terraform --version --json | jq -r .terraform_version
Specifically asked for min-required via terraform{required_version}, but none found
$

You can even run into a prompt where not even tfenv is active, i.e.:

$ terraform --version --json | jq -r .terraform_version

Command 'terraform' not found
$

You'll have to cope with that case one way or the other.

@mengesb
Copy link

mengesb commented Sep 22, 2023

Maybe https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/terraform is what you're looking for?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants