Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Environment variable for non-standard install location #562

Open
yermulnik opened this issue Mar 10, 2025 · 5 comments · May be fixed by #566
Open

[Feature request] Environment variable for non-standard install location #562

yermulnik opened this issue Mar 10, 2025 · 5 comments · May be fixed by #566
Assignees
Labels
installation Installation related issue new feature New feature or request

Comments

@yermulnik
Copy link
Collaborator

Discussed in #561

Originally posted by dbopus2 March 10, 2025
Would you consider adding an environment variable for non-standard install location? Same functionality as the -i and --install cli options.

@yermulnik yermulnik added new feature New feature or request installation Installation related issue labels Mar 10, 2025
@yermulnik
Copy link
Collaborator Author

yermulnik commented Mar 10, 2025

Also:

@yermulnik
Copy link
Collaborator Author

yermulnik commented Mar 10, 2025

This partially overlaps with #559, so I'll need to have that other PR merged first before I can start looking into this feature request 🤷🏻

@yermulnik yermulnik self-assigned this Mar 11, 2025
@mj790
Copy link

mj790 commented Mar 12, 2025

I'd actually like to see the -i option added to the TOML file as well.

Had a situation come up at work the other day where this would come in very handy. On a shared server with a small C drive, if we have a bunch of users that work with multiple different terraform versions it can start to add up.

Having to pass -i to tfswitch all the time is a pain so being able to default the alternate location in the TOML file would be great.

@yermulnik
Copy link
Collaborator Author

@mj790 Thanks for describing your use case. Usual "thumbs up" to the first message would allow us to easily prioritize issues 👍🏻 I'll work on this request once that other PR is reviewed and approved by @warrensbox and @MatthewJohn. Stay tuned 🎶

yermulnik added a commit that referenced this issue Mar 14, 2025
Resolves #562

* Add Env vars for custom binary path and custom install path
* Add TOML config key for custom install path for consistency
* Improve wording in resolved parameter values debugging output
* Add tests for new Env vars and TOML config key
* Documentation
  * Update https://tfswitch.warrensbox.com/usage/commandline/ accordingly
  * Update https://tfswitch.warrensbox.com/usage/config-files/ accordingly
  * Add `arch` and `log-level` TOML keys description to https://tfswitch.warrensbox.com/usage/config-files/
  * Improve wording in some places
@yermulnik yermulnik linked a pull request Mar 14, 2025 that will close this issue
@yermulnik
Copy link
Collaborator Author

#566
Implementation caveat: the var and config attribute are going to be consistent with cmdline arg and the specified path will be appended with .terraform.versions (so if you specify /tmp, the final install directory will be /tmp/.terraform.versions). JFYI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installation Installation related issue new feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants