tfutils / tfenv

Terraform version manager
MIT License
4.51k stars 454 forks source link

Trailing whitespace breaks version resolution #431

Open Meosit opened 6 months ago

Meosit commented 6 months ago

I was setting up existing repo with .terraform-version file of the project that I've just pulled and there is a issue that I was facing:

data-infra $ terraform -v
/opt/homebrew/Cellar/tfenv/3.0.0/lib/tfenv-version-name.sh: line 75: requested: unbound variable

The root cause of the issue is that the .terraform-version had the following content (WITH new line in the end of the file):

latest:^1.7

The issue fix probably should be located here: https://github.com/tfutils/tfenv/blob/v3.0.0/libexec/tfenv-resolve-version#L132

julian-alarcon commented 5 months ago

Got the same issue. Is this still maintained?

kvendingoldo commented 5 months ago

@julian-alarcon try to switch to https://github.com/tofuutils/tenv, we have covered this issue