Skip to content

Commit

Permalink
use checkTFEnvExist - better
Browse files Browse the repository at this point in the history
  • Loading branch information
warrensbox committed Feb 5, 2021
1 parent 326f572 commit 0c96420
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func main() {
case checkTFModuleFileExist(dir) && len(args) == 0:
installTFProvidedModule(dir, &binPath)
/* if Terraform Version environment variable is set */
case checkEnvExist() && len(args) == 0 && version == "":
case checkTFEnvExist() && len(args) == 0 && version == "":
tfversion := os.Getenv("TF_VERSION")
fmt.Printf("Terraform version environment variable: %s\n", tfversion)
installVersion(tfversion, custBinPath)
Expand Down Expand Up @@ -190,7 +190,7 @@ func main() {
installTFProvidedModule(dir, custBinPath)

/* if Terraform Version environment variable is set */
case checkEnvExist() && len(args) == 0:
case checkTFEnvExist() && len(args) == 0:
tfversion := os.Getenv("TF_VERSION")
fmt.Printf("Terraform version environment variable: %s\n", tfversion)
installVersion(tfversion, custBinPath)
Expand Down Expand Up @@ -296,7 +296,7 @@ func checkTFModuleFileExist(dir string) bool {

// fileExists checks if a file exists and is not a directory before we
// try using it to prevent further errors.
func checkEnvExist() bool {
func checkTFEnvExist() bool {
tfversion := os.Getenv("TF_VERSION")
if tfversion != "" {
return true
Expand Down

0 comments on commit 0c96420

Please sign in to comment.