mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-22 08:57:40 +08:00
cmd: Print error if fmt overwrite fails (fix #4524)
This commit is contained in:
parent
1feb65952a
commit
1a7a78a1f2
|
@ -567,7 +567,7 @@ func cmdFmt(fl Flags) (int, error) {
|
|||
|
||||
if fl.Bool("overwrite") {
|
||||
if err := os.WriteFile(formatCmdConfigFile, output, 0600); err != nil {
|
||||
return caddy.ExitCodeFailedStartup, nil
|
||||
return caddy.ExitCodeFailedStartup, fmt.Errorf("overwriting formatted file: %v", err)
|
||||
}
|
||||
} else {
|
||||
fmt.Print(string(output))
|
||||
|
|
Loading…
Reference in New Issue
Block a user