tfenv icon indicating copy to clipboard operation
tfenv copied to clipboard

tfenv use functionality seems broken

Open jpooler opened this issue 9 years ago • 7 comments

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

jpooler avatar Jan 03 '17 19:01 jpooler

Thank you for reporting! I'll have a look at it.

kamatama41 avatar Jan 04 '17 01:01 kamatama41

My workaround - using a shell terraform.sh script with this block inside

setup_tfenv_path() {
    PATH="${TF_ENV_BIN_DIR}:${PATH}"
}

SerCeMan avatar Jan 04 '17 04:01 SerCeMan

@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/bin to your $PATH
  • Put symlinks of scripts in tfenv/bin to a directory that is already added to your $PATH (e.g. /usr/local/bin)

Thanks 😃

kamatama41 avatar Jan 04 '17 13:01 kamatama41

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 avatar Jan 04 '17 13:01 jpooler

@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 avatar Jan 04 '17 13:01 kamatama41

@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.

jpooler avatar Jan 04 '17 14:01 jpooler

Thanks for details, it makes sense!

kamatama41 avatar Jan 04 '17 15:01 kamatama41