tfenv use functionality seems broken
Hi,
I am able to install any version of terraform, but when I do "tfenv use $version" it just spits out the current version I have installed in /usr/local/bin/terraform.
Please note that this was also tested with and without a .terraform-version file in the repos.
I uninstalled the repo and then reinstalled to no avail.
Thoughts?
Thanks, Jarrod
Thank you for reporting! I'll have a look at it.
My workaround - using a shell terraform.sh script with this block inside
setup_tfenv_path() {
PATH="${TF_ENV_BIN_DIR}:${PATH}"
}
@jpooler @SerCeMan
Sorry, the description in README for installing tfenv with symlink was incorrect.
tfenv/bin/terraform also needs to be added (symlinked) to /usr/local/bin.
I've fixed README and as it tells, we can choose two ways to work tfenv.
- Add
tfenv/binto your$PATH - Put symlinks of scripts in
tfenv/binto a directory that is already added to your$PATH(e.g./usr/local/bin)
Thanks 😃
Looks good to me, was this happening automatically before or something? I already had tfenv/bin in my $PATH but had not symlinked the entire dir to /usr/local/bin until this morning.
Thanks for your quick work @kamatama41 !
@jpooler
Umm, symlink support was merged yesterday (1/3 9:29 AM UTC) so it might affect your environment.
Please let me confirm, when you encountered the error, had you used tfenv before symlink support and installed it by the approach to add tfenv/bin into your $PATH then updated to latest version in this morning (what time?) ?
@kamatama41
I had been using tfenv in 0.3.1 (no git tag :-P, I tried to revert to a previous commit but eventually figured making an issue was a better plan ), justaddingtfenv/binto my$PATH`. I updated to latest tfenv as of 1/3 3:00 UTC, since I'd just got back from vacation and was updating packages. At that point I tried using tfenv to install the latest terraform and it downloaded it, but didn't modify the terraform version as it had been doing previously.
I'd added this line to my .bashrc file previously, export PATH="$PATH:~/Tools/git/tfenv/bin", but have since modified it to: export PATH="~/Tools/git/tfenv/bin:$PATH" so that the terraform version in that bin directory will supersede /usr/local/bin.
Thanks for details, it makes sense!