From 5645b39f7b1a41f67e7f1824c280d0917ff4b0d1 Mon Sep 17 00:00:00 2001 From: warren-veerasingam Date: Sat, 19 May 2018 14:00:45 -0500 Subject: [PATCH] more formatting --- main.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index 89392710..2481000a 100644 --- a/main.go +++ b/main.go @@ -5,7 +5,7 @@ package main * Compatible with Mac OS X ONLY */ -/*** WORKFLOW ***/ +/*** OPERATION WORKFLOW ***/ /* * 1- Create /usr/local/terraform directory if does not exist * 2- Download zip file from url to /usr/local/terraform @@ -41,6 +41,7 @@ const ( installVersion = "terraform_" binLocation = "/usr/local/bin/terraform" installPath = "/.terraform.versions/" + macOS = "_darwin_amd64.zip" ) func main() { @@ -135,10 +136,10 @@ func main() { /* if selected version already exist, */ /* proceed to download it from the hashicorp release page */ - url := hashiURL + version + "/terraform_" + version + "_darwin_amd64.zip" + url := hashiURL + version + "/" + installVersion + version + macOS zipFile, _ := lib.DownloadFromURL(installLocation, url) - fmt.Printf("Downloaded zipFile: %q \n", zipFile) + fmt.Printf("Downloaded zipFile: %v \n", zipFile) /* unzip the downloaded zipfile */ files, errUnzip := lib.Unzip(zipFile, installLocation) @@ -148,13 +149,13 @@ func main() { os.Exit(1) } - fmt.Println("Unzipped:" + strings.Join(files, "\n")) + fmt.Println("Unzipped: " + strings.Join(files, "\n")) /* rename unzipped file to terraform version name - terraform_x.x.x */ lib.RenameFile(installLocation+installFile, installLocation+installVersion+version) /* remove zipped file to clear clutter */ - lib.RemoveFiles(installLocation + installVersion + version + "_darwin_amd64.zip") + lib.RemoveFiles(installLocation + installVersion + version + macOS) /* remove current symlink and set new symlink to desired version */ lib.RemoveSymlink(installedBinPath)