Didn't know how to resume it better x)
If you set the tfenv version to 0.11.14 and enter a directory with a .terraform-version that points to 0.12.4, it changes the tfenv version globally. That means that when you go outside that directory, it doesn't revert the tfenv version to 0.11.14, it maintains the 0.12.4 version. I think it should do it as the default behaviour.
PD: tfenv it's very cool, thanks for your work!
Think this ties into another ticket or so addressing how we deal with version files and the use
command. It's on the list.
On mac, the mechanism of /usr/local/bin/terraform creates this problem. tfenv should be setting PATH or similar for the right version of terraform in the environment rather than creating symlinks or other files on the FS which acts globally.
Doing such things means its not possible to run concurrent terraform invocations with different versions using this tool.
(Sure you knew that anyway, but thats my problem - which means i cant use tfenv at all for CI)
Not addressing this (environment manipulation instead of system-level default) in v2.0.0 as 2.0.0 is a significant rewrite that is already stable; will perhaps look at it for v2.1.0.
Two solutions for CI configurations where parallel execution is required:
use
command is required, just execute terraform
with a .terraform-version file that is unique to the CI execution.See https://github.com/tfutils/tfenv/tree/v2.0.0-beta1 for the 2.0.0 release candidate. Now does not overwrite .terraform-version files.
Most helpful comment
On mac, the mechanism of /usr/local/bin/terraform creates this problem. tfenv should be setting PATH or similar for the right version of terraform in the environment rather than creating symlinks or other files on the FS which acts globally.
Doing such things means its not possible to run concurrent terraform invocations with different versions using this tool.
(Sure you knew that anyway, but thats my problem - which means i cant use tfenv at all for CI)