I think this is pretty self-explanatory:
$ caddy adapt
Error: input file required when there is no Caddyfile in current directory (use --config flag)
$ caddy validate
Error: decoding config: unexpected end of JSON input
The validate command, unlike adapt misses check that assesses the file even exists in the first place. With that, the user may assume the file was read and that they have some syntax error they'll be endlessly looking for, even though that's not the problem...
Check for adapt exists here:
|
if adaptCmdInputFlag == "" { |
|
return caddy.ExitCodeFailedStartup, |
|
fmt.Errorf("input file required when there is no Caddyfile in current directory (use --config flag)") |
|
} |
Missing in this func:
|
func cmdValidateConfig(fl Flags) (int, error) { |
Should be simple fix for someone who already has a dev environment setup to test it out before committing (hence I'm creating an issue and not PR)
I think this is pretty self-explanatory:
The
validatecommand, unlikeadaptmisses check that assesses the file even exists in the first place. With that, the user may assume the file was read and that they have some syntax error they'll be endlessly looking for, even though that's not the problem...Check for adapt exists here:
caddy/cmd/commandfuncs.go
Lines 439 to 442 in dfe17c3
Missing in this func:
caddy/cmd/commandfuncs.go
Line 506 in dfe17c3
Should be simple fix for someone who already has a dev environment setup to test it out before committing (hence I'm creating an issue and not PR)