Skip to content

Commit

Permalink
added env variable option
Browse files Browse the repository at this point in the history
  • Loading branch information
warrensbox committed Feb 4, 2021
1 parent 96bb53a commit bc3a080
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ func main() {
case checkTFModuleFileExist(dir) && len(args) == 0:
installTFProvidedModule(dir, &binPath)
case checkEnvExist() && len(args) == 0 && version == "":
installVersion(os.Getenv("TFVERSION"), custBinPath)
tfversion := os.Getenv("TFVERSION")
fmt.Printf("Reading environment variable: %s\n", tfversion)
installVersion(tfversion, custBinPath)
case version != "":
installVersion(version, &binPath)
default:
Expand Down Expand Up @@ -178,7 +180,9 @@ func main() {

/* if TF environment variable is set */
case checkEnvExist() && len(args) == 0:
installVersion(os.Getenv("TFVERSION"), custBinPath)
tfversion := os.Getenv("TFVERSION")
fmt.Printf("Reading environment variable: %s\n", tfversion)
installVersion(tfversion, custBinPath)

// if no arg is provided
default:
Expand Down

0 comments on commit bc3a080

Please sign in to comment.