From 68b07a28cb444709e95f79e74f38a6a821324db3 Mon Sep 17 00:00:00 2001 From: Jukie <10012479+Jukie@users.noreply.github.com> Date: Tue, 21 Mar 2023 18:08:57 -0600 Subject: [PATCH] Fix binPath when getting latest --- main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 33048edf..c665cb02 100644 --- a/main.go +++ b/main.go @@ -115,14 +115,14 @@ func main() { /* latest pre-release implicit version. Ex: tfswitch --latest-pre 0.13 downloads 0.13.0-rc1 (latest) */ case *latestPre != "": preRelease := true - installLatestImplicitVersion(*latestPre, custBinPath, mirrorURL, preRelease) + installLatestImplicitVersion(*latestPre, &binPath, mirrorURL, preRelease) /* latest implicit version. Ex: tfswitch --latest 0.13 downloads 0.13.5 (latest) */ case *latestStable != "": preRelease := false - installLatestImplicitVersion(*latestStable, custBinPath, mirrorURL, preRelease) + installLatestImplicitVersion(*latestStable, &binPath, mirrorURL, preRelease) /* latest stable version */ case *latestFlag: - installLatestVersion(custBinPath, mirrorURL) + installLatestVersion(&binPath, mirrorURL) /* version provided on command line as arg */ case len(args) == 1: installVersion(args[0], &binPath, mirrorURL) @@ -143,7 +143,7 @@ func main() { case checkTFEnvExist() && len(args) == 0 && version == "": tfversion := os.Getenv("TF_VERSION") fmt.Printf("Terraform version environment variable: %s\n", tfversion) - installVersion(tfversion, custBinPath, mirrorURL) + installVersion(tfversion, &binPath, mirrorURL) /* if terragrunt.hcl file found (IN ADDITION TO A TOML FILE) */ case fileExists(TGHACLFile) && checkVersionDefinedHCL(&TGHACLFile) && len(args) == 0: installTGHclFile(&TGHACLFile, &binPath, mirrorURL)