Commit e9515425 authored by Whitestrake's avatar Whitestrake Committed by Matt Holt

use import to handle globbed values for -conf flag (#1973)

parent c80c34ef
...@@ -170,10 +170,18 @@ func confLoader(serverType string) (caddy.Input, error) { ...@@ -170,10 +170,18 @@ func confLoader(serverType string) (caddy.Input, error) {
return caddy.CaddyfileFromPipe(os.Stdin, serverType) return caddy.CaddyfileFromPipe(os.Stdin, serverType)
} }
contents, err := ioutil.ReadFile(conf) var contents []byte
if err != nil { if strings.Contains(conf, "*") {
return nil, err // Let caddyfile.doImport logic handle the globbed path
contents = []byte("import " + conf)
} else {
var err error
contents, err = ioutil.ReadFile(conf)
if err != nil {
return nil, err
}
} }
return caddy.CaddyfileInput{ return caddy.CaddyfileInput{
Contents: contents, Contents: contents,
Filepath: conf, Filepath: conf,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment