tofuutils / tenv

OpenTofu / Terraform / Terragrunt and Atmos version manager
https://tofuutils.github.io/tenv/
Apache License 2.0
662 stars 32 forks source link

TENV_AUTO_INSTALL is not working #198

Closed myoung34 closed 3 months ago

myoung34 commented 3 months ago

Describe the bug

I have TENV_AUTO_INSTALL set to true, but tenv refuses to acknowlege it

To Reproduce

➜  talos git:(main) echo $TENV_AUTO_INSTALL
true
➜  talos git:(main) tenv tf detect -n
Resolved version from .terraform-version : 1.9.0
Auto-install is disabled. To install Terraform version 1.9.0, you can set environment variable TENV_AUTO_INSTALL=true, or install it via any of the following command: 'tenv terraform install', 'tenv terraform install 1.9.0'
no compatible version found locally
Terraform 1.9.0 will be run from this directory.

Expected behavior

tfenv should install what's in .terraform-version

Screenshots

Environment (please complete the following information):

Additional context

kvendingoldo commented 3 months ago

Looks like a bug. Thank you for reporting, we'll fix it

dvaumoron commented 3 months ago

Hi @myoung34, there is a -n flag (same as --no-install) in your command, this flag override the TENV_AUTO_INSTALL env var

kvendingoldo commented 3 months ago

@dvaumoron how do you think, do we still need this flag?

dvaumoron commented 3 months ago

as now, auto install default to disabled, it's strange to use -n=false to activate it with the flag, we should probably add a simpler -i (still with priority to -n)