From af25f0254e94eb2e2898ba495bfc3de209a49e79 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Thu, 22 Aug 2019 13:38:37 -0600 Subject: caddyfile: Support global config block; allow non-empty blocks w/ 0 keys --- cmd/commands.go | 2 +- cmd/main.go | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'cmd') diff --git a/cmd/commands.go b/cmd/commands.go index 99ec642..bb5429c 100644 --- a/cmd/commands.go +++ b/cmd/commands.go @@ -331,7 +331,7 @@ func cmdAdaptConfig() (int, error) { fmt.Errorf("reading input file: %v", err) } - opts := make(map[string]string) + opts := make(map[string]interface{}) if *adaptCmdPrettyFlag { opts["pretty"] = "true" } diff --git a/cmd/main.go b/cmd/main.go index e0a3686..e2f1233 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -131,9 +131,8 @@ func loadConfig(configFile, adapterName string) ([]byte, error) { // adapt config if cfgAdapter != nil { - adaptedConfig, warnings, err := cfgAdapter.Adapt(config, map[string]string{ + adaptedConfig, warnings, err := cfgAdapter.Adapt(config, map[string]interface{}{ "filename": configFile, - // TODO: all other options... (http-port, etc...) }) if err != nil { return nil, fmt.Errorf("adapting config using %s: %v", adapterName, err) -- cgit v1.2.3