The toml file - How to deal with it. #420
Replies: 9 comments 37 replies
-
I agree. This all makes sense. But this means we need to reverse the order of precedence in the docu as the highest precedence actually has env var, right?
Caveat: non- Does this sound meaningful? |
Beta Was this translation helpful? Give feedback.
-
So, yes, the main issue I'm seeing, assuming I've got the right impression is this: https://github.com/warrensbox/terraform-switcher/blob/master/lib/param_parsing/parameters.go#L59
If a TOML file exists (whether it specifies the version or no)t, then we're just completely ignoring versions from any other sources |
Beta Was this translation helpful? Give feedback.
-
Issues:
|
Beta Was this translation helpful? Give feedback.
-
@MatthewJohn @yermulnik |
Beta Was this translation helpful? Give feedback.
-
@yermulnik can you please help me test these 2 cases:
It should change the terraform version to However the latest version of |
Beta Was this translation helpful? Give feedback.
-
@MatthewJohn @yermulnik |
Beta Was this translation helpful? Give feedback.
-
Also, when you do not have a RECENT file, it is no longer creating a RECENT file.
|
Beta Was this translation helpful? Give feedback.
-
I had changed it in the original PR to only append in the UI.. but after merging main into the branch with the Redone JSON changes, I missed re-removing the functionality
…Sent from my iPhone
On 6 Jun 2024, at 21:23, Warren Veerasingam ***@***.***> wrote:
I think the way *recent is being appended is incorrect. Please see how we did it in 1.0.2
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
Beta Was this translation helpful? Give feedback.
-
I agree to the environment variable being the highest precedence. Please see this issue for a valid scenario for this: #491 |
Beta Was this translation helpful? Give feedback.
-
The TOML file was created because users wanted to specify a
bin path
location in a config file. When we first released this feature, the toml file was in the HOME directory. So when a user uses tfswitch in any directory, it immediately knows where to install the bin path.User can run tfswitch anywhere not having to worry where the bin path would be. They do not need to pass the -b parameter all the time, as well.
What if you just wanted to have the version also configured in the
toml
file? That's were the version option came in. But again this can be overridden later.But what is the .toml file is not in the HOME directory. That's where the option to pass the
-c
came in.SO we still need to make the
toml
file readable as well incorporating the ability to have the version overridden.see: https://github.com/warrensbox/terraform-switcher/blob/1.0.2/main.go#L99C2-L99C68
Please let me know if you have any questions. We should refactor the existing code to match this behavior. I am open to other ideas as well.
@yermulnik @MatrixCrawler @crablab @MatthewJohn
Beta Was this translation helpful? Give feedback.
All reactions