Skip to content

Commit

Permalink
renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
dvaumoron committed Feb 2, 2024
1 parent 7b4bef3 commit 7461db6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions versionmanager/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,26 @@ import (
tofuretriever "github.com/tofuutils/tenv/versionmanager/retriever/tofu"
"github.com/tofuutils/tenv/versionmanager/semantic"
flatparser "github.com/tofuutils/tenv/versionmanager/semantic/parser/flat"
tgswitchparser "github.com/tofuutils/tenv/versionmanager/semantic/parser/tgswitch"
tomlparser "github.com/tofuutils/tenv/versionmanager/semantic/parser/toml"
)

func BuildTfManager(conf *config.Config) versionmanager.VersionManager {
tfRetriever := terraformretriever.NewTerraformRetriever(conf)
versionFiles := []semantic.VersionFile{{Name: ".terraform-version", Parser: flatparser.RetrieveVersionFromFile}, {Name: ".tfswitchrc", Parser: flatparser.RetrieveVersionFromFile}}
versionFiles := []semantic.VersionFile{{Name: ".terraform-version", Parser: flatparser.RetrieveVersion}, {Name: ".tfswitchrc", Parser: flatparser.RetrieveVersion}}

return versionmanager.MakeVersionManager(conf, "Terraform", semantic.TfPredicateReaders, tfRetriever, config.TfVersionEnvName, versionFiles)
}

func BuildTgManager(conf *config.Config) versionmanager.VersionManager {
tgRetriever := terragruntretriever.NewTerragruntRetriever(conf)
versionFiles := []semantic.VersionFile{{Name: ".terragrunt-version", Parser: flatparser.RetrieveVersionFromFile}, {Name: ".tgswitchrc", Parser: flatparser.RetrieveVersionFromFile}, {Name: ".tgswitch.toml", Parser: tgswitchparser.RetrieveTerraguntVersionFromFile}}
versionFiles := []semantic.VersionFile{{Name: ".terragrunt-version", Parser: flatparser.RetrieveVersion}, {Name: ".tgswitchrc", Parser: flatparser.RetrieveVersion}, {Name: ".tgswitch.toml", Parser: tomlparser.RetrieveVersion}}

return versionmanager.MakeVersionManager(conf, "Terragrunt", semantic.TgPredicateReaders, tgRetriever, config.TgVersionEnvName, versionFiles)
}

func BuildTofuManager(conf *config.Config) versionmanager.VersionManager {
tofuRetriever := tofuretriever.NewTofuRetriever(conf)
versionFiles := []semantic.VersionFile{{Name: ".opentofu-version", Parser: flatparser.RetrieveVersionFromFile}}
versionFiles := []semantic.VersionFile{{Name: ".opentofu-version", Parser: flatparser.RetrieveVersion}}

return versionmanager.MakeVersionManager(conf, "OpenTofu", semantic.TfPredicateReaders, tofuRetriever, config.TofuVersionEnvName, versionFiles)
}
2 changes: 1 addition & 1 deletion versionmanager/semantic/parser/flat/flatparser.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"os"
)

func RetrieveVersionFromFile(filePath string, verbose bool) (string, error) {
func RetrieveVersion(filePath string, verbose bool) (string, error) {
data, err := os.ReadFile(filePath)
if err != nil {
if verbose {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
*/

package tgswitchparser
package tomlparser

import (
"fmt"
Expand All @@ -27,7 +27,7 @@ import (

const versionName = "version"

func RetrieveTerraguntVersionFromFile(filePath string, verbose bool) (string, error) {
func RetrieveVersion(filePath string, verbose bool) (string, error) {
data, err := os.ReadFile(filePath)
if err != nil {
if verbose {
Expand Down

0 comments on commit 7461db6

Please sign in to comment.