Skip to content

Commit 11389b4

Browse files
committed
if arg is passed merge it with json file params.
1 parent fc450e4 commit 11389b4

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

cmd/render.go

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -128,20 +128,18 @@ func render(cmd *cobra.Command, args []string) error {
128128
if err != nil {
129129
return fmt.Errorf("something wrong with json %v", configJson)
130130
}
131-
132-
log.Printf("got json config of %v", config)
133-
134-
} else {
135-
136-
for _, param := range args[1:] {
137-
split := strings.Split(param, "=")
138-
if len(split) < 2 {
139-
return fmt.Errorf("parameters must be on form <key>=<value>, found %s", param)
140-
}
141-
config[split[0]] = strings.Join(split[1:], "=")
131+
132+
}
133+
134+
for _, param := range args[1:] {
135+
split := strings.Split(param, "=")
136+
if len(split) < 2 {
137+
return fmt.Errorf("parameters must be on form <key>=<value>, found %s", param)
142138
}
143-
139+
config[split[0]] = strings.Join(split[1:len(split)], "=")
144140
}
141+
142+
log.Printf("got config of %v",config)
145143

146144
cache := runtime.NewInMemoryCache()
147145
runtime.InitHTTP(cache)

0 commit comments

Comments
 (0)