warrensbox/terraform-switcher

Take explicit version given to CLI as highest priority

Closed this issue · 3 comments

If I run tfswitch in a directory with a versions.tf file in it, tfswitch ignores the argument that I give it and only cares about the info in the versions.tf file.

11:07:00 ❯ cat versions.tf
terraform {
  required_version = ">= 0.12"
}

11:11:13 ❯ tfswitch 0.13.5
Reading configuration from home directory for .tfswitch.toml
Reading required version from terraform file, constraint: >= 0.12
Matched version: 0.14.2
Switched terraform to version "0.14.2"

This seems to only be the case when you have a ~/.tfswitch.toml

Thanks. I will review this soon.

Yes, plz!

@nlarzon @grimm26
I tested and released this - version 0.9.939. Please get the latest version -
https://tfswitch.warrensbox.com/Upgrade-or-Uninstall/
Please help me test it and let me know if it's working correctly.
Thank you.