Skip to content

Commit 8bef95c

Browse files
committed
fix: config genVars in retrieve method
1 parent 4b34421 commit 8bef95c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

cmd/configmanager/configmanager.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"flag"
55
"os"
66

7+
"github.com/dnitsch/configmanager"
78
"github.com/dnitsch/configmanager/pkg/generator"
89
"github.com/dnitsch/configmanager/pkg/log"
910
)
@@ -27,13 +28,16 @@ var (
2728

2829
func main() {
2930
flag.Parse()
31+
configmanager.Retrieve(token, generator.GenVarsConfig{Outpath: path, TokenSeparator: tokenSeparator})
3032
gv := generator.New()
3133
gv.WithConfig(&generator.GenVarsConfig{Outpath: path})
3234
_, err := gv.Generate(token)
3335
if err != nil {
3436
log.Errorf("%e", err)
3537
os.Exit(1)
3638
}
39+
40+
// Conver to ExportVars
3741
gv.ConvertToExportVar()
3842

3943
f, err := gv.FlushToFile()

configmanager.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import (
88

99
// Retrieve gets a rawMap from a set implementaion
1010
// will be empty if no matches found
11-
func Retrieve(tokens []string, config *generator.GenVarsConfig) (generator.ParsedMap, error) {
11+
func Retrieve(tokens []string, config generator.GenVarsConfig) (generator.ParsedMap, error) {
1212
gv := generator.New()
13-
gv.WithConfig(config)
13+
gv.WithConfig(&config)
1414
return gv.Generate(tokens)
1515
}
1616

0 commit comments

Comments
 (0)