From bc3a080bd835a7e97a2131caac335a0692bfef75 Mon Sep 17 00:00:00 2001 From: "warren.veerasingam" Date: Fri, 5 Feb 2021 00:00:14 +0800 Subject: [PATCH] added env variable option --- main.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 07011ab3..32bd083f 100644 --- a/main.go +++ b/main.go @@ -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: @@ -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: