Skip to content

Commit

Permalink
Merge pull request #295 from jukie/jukie/fix-binpath-2
Browse files Browse the repository at this point in the history
Fix binPath when getting latest
  • Loading branch information
crablab committed Mar 27, 2024
2 parents 3af6a33 + 68b07a2 commit 5381b65
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.go
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 5381b65

Please sign in to comment.