warrensbox / terraform-switcher

A command line tool to switch between different versions of terraform (install with homebrew and more)
https://tfswitch.warrensbox.com
MIT License
1.33k stars 133 forks source link

Standardise logic for failing/warning when an error occurs during terraform version detection #451

Open MatthewJohn opened 3 weeks ago

MatthewJohn commented 3 weeks ago

Is your feature request related to a problem? Please describe.

There are two use-cases when running tfswitch:

Describe the solution you'd like

As suggested in the thread on/after https://github.com/warrensbox/terraform-switcher/pull/429#discussion_r1624655080, we could/should detect for a valid TTY and act accordingly. If there is no TTY, then we should fail when these errors occur, otherwise, we should continue to ask the user for input.

yermulnik commented 3 weeks ago

Out of curiosity: what that screencast (git switch branch + open main.go in vi) is meant for? 🤔

MatthewJohn commented 3 weeks ago

Out of curiosity: what that screencast (git switch branch + open main.go in vi) is meant for? 🤔

Ah, I saw it in the new issue template and wondered what it was - and then forgot to remove it!

warrensbox commented 3 weeks ago

Can this wait after release 1.2.0?

yermulnik commented 3 weeks ago

Can this wait after release 1.2.0?

It probably can. Though this "bug" may impact someone's CI/CD pipeline by halting it to wait for an input w/o a meaningful reason. I'd personally target this to be release as soon as possible. Though! Though we may (and need) to establish release cadence if we may (and can) provide a more-or-less stable release cadence I guess.