Skip to content

Commit

Permalink
Merge pull request warrensbox#123 from warrensbox/feature/v0.5
Browse files Browse the repository at this point in the history
Fix typos
  • Loading branch information
warrensbox authored Jun 23, 2022
2 parents 930d60a + 3328e7d commit 9cc4c53
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func GetHomeDirectory() string {
return homedir
}

// GetFileName : remove file ext. .tfswitch.config returns .tfswitch
// GetFileName : remove file ext. .tgswitch.config returns .tgswitch
func GetFileName(configfile string) string {
return strings.TrimSuffix(configfile, filepath.Ext(configfile))
}
Expand Down
4 changes: 2 additions & 2 deletions lib/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ func ValidVersionFormat(version string) bool {
//Install : Install the provided version in the argument
func Install(tgversion string, usrBinPath string, mirrorURL string) string {
/* Check to see if user has permission to the default bin location which is "/usr/local/bin/terragrunt"
* If user does not have permission to default bin location, proceed to create $HOME/bin and install the tfswitch there
* Inform user that they dont have permission to default location, therefore tfswitch was installed in $HOME/bin
* If user does not have permission to default bin location, proceed to create $HOME/bin and install the tgswitch there
* Inform user that they dont have permission to default location, therefore tgswitch was installed in $HOME/bin
* Tell users to add $HOME/bin to their path
*/
binPath := InstallableBinLocation(usrBinPath)
Expand Down
12 changes: 6 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ var version = "0.5.0\n"
func main() {

dir := lib.GetCurrentDirectory()
custBinPath := getopt.StringLong("bin", 'b', lib.ConvertExecutableExt(defaultBin), "Custom binary path. Ex: tfswitch -b "+lib.ConvertExecutableExt("/Users/username/bin/terragrunt"))
custBinPath := getopt.StringLong("bin", 'b', lib.ConvertExecutableExt(defaultBin), "Custom binary path. Ex: tgswitch -b "+lib.ConvertExecutableExt("/Users/username/bin/terragrunt"))
versionFlag := getopt.BoolLong("version", 'v', "displays the version of tgswitch")
helpFlag := getopt.BoolLong("help", 'h', "displays help message")
chDirPath := getopt.StringLong("chdir", 'c', dir, "Switch to a different working directory before executing the given command. Ex: tgswitch --chdir terragrunt dir will run tfswitch in the directory")
chDirPath := getopt.StringLong("chdir", 'c', dir, "Switch to a different working directory before executing the given command. Ex: tgswitch --chdir terragrunt dir will run tgswitch in the directory")
_ = versionFlag

getopt.Parse()
Expand Down Expand Up @@ -119,7 +119,7 @@ func main() {
/* if terragrunt.hcl file found (IN ADDITION TO A TOML FILE) */
case lib.FileExists(TGHACLFile) && checkVersionDefinedHCL(&TGHACLFile) && len(args) == 0:
installTGHclFile(&TGHACLFile, binPath, proxyUrl)
/* if Terraform Version environment variable is set (IN ADDITION TO A TOML FILE)*/
/* if terragrunt Version environment variable is set (IN ADDITION TO A TOML FILE)*/
case checkTGEnvExist() && len(args) == 0 && version == "":
tgversion := os.Getenv("TG_VERSION")
fmt.Printf("Terragrunt version environment variable: %s\n", tgversion)
Expand Down Expand Up @@ -159,7 +159,7 @@ func main() {
/* if terragrunt.hcl file found */
case lib.FileExists(TGHACLFile) && checkVersionDefinedHCL(&TGHACLFile) && len(args) == 0:
installTGHclFile(&TGHACLFile, *custBinPath, proxyUrl)
/* if Terraform Version environment variable is set*/
/* if terragrunt Version environment variable is set*/
case checkTGEnvExist() && len(args) == 0:
tgversion := os.Getenv("TG_VERSION")
fmt.Printf("Terragrunt version environment variable: %s\n", tgversion)
Expand Down Expand Up @@ -245,7 +245,7 @@ func installVersion(arg string, custBinPath *string) {
recentDownloadFile := lib.CheckFileExist(installFileVersionPath)
if recentDownloadFile {
lib.ChangeSymlink(installFileVersionPath, *custBinPath)
fmt.Printf("Switched terraform to version %q \n", requestedVersion)
fmt.Printf("Switched terragrunt to version %q \n", requestedVersion)
lib.AddRecent(requestedVersion) //add to recent file for faster lookup
os.Exit(0)
}
Expand All @@ -264,7 +264,7 @@ func installVersion(arg string, custBinPath *string) {
} else {
lib.PrintInvalidTGVersion()
usageMessage()
log.Fatalln("Args must be a valid terraform version")
log.Fatalln("Args must be a valid terragrunt version")
}
}

Expand Down

0 comments on commit 9cc4c53

Please sign in to comment.