Skip to content

Commit

Permalink
if arg is passed merge it with json file params.
Browse files Browse the repository at this point in the history
  • Loading branch information
tavdog committed Mar 4, 2025
1 parent fc450e4 commit 11389b4
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions cmd/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,20 +128,18 @@ func render(cmd *cobra.Command, args []string) error {
if err != nil {
return fmt.Errorf("something wrong with json %v", configJson)
}

log.Printf("got json config of %v", config)

} else {

for _, param := range args[1:] {
split := strings.Split(param, "=")
if len(split) < 2 {
return fmt.Errorf("parameters must be on form <key>=<value>, found %s", param)
}
config[split[0]] = strings.Join(split[1:], "=")

}

for _, param := range args[1:] {
split := strings.Split(param, "=")
if len(split) < 2 {
return fmt.Errorf("parameters must be on form <key>=<value>, found %s", param)
}

config[split[0]] = strings.Join(split[1:len(split)], "=")
}

log.Printf("got config of %v",config)

cache := runtime.NewInMemoryCache()
runtime.InitHTTP(cache)
Expand Down

0 comments on commit 11389b4

Please sign in to comment.