fix dump non-exist log directory (#9818) (#9820)

Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
Lunny Xiao 2020-01-17 15:51:21 +08:00 committed by Antoine GIRARD
parent ed6a2f2e2e
commit 9809fe27c4
1 changed files with 4 additions and 2 deletions

View File

@ -145,9 +145,11 @@ func runDump(ctx *cli.Context) error {
} }
} }
if com.IsExist(setting.LogRootPath) {
if err := z.AddDir("log", setting.LogRootPath); err != nil { if err := z.AddDir("log", setting.LogRootPath); err != nil {
log.Fatalf("Failed to include log: %v", err) log.Fatalf("Failed to include log: %v", err)
} }
}
if err = z.Close(); err != nil { if err = z.Close(); err != nil {
_ = os.Remove(fileName) _ = os.Remove(fileName)