aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2020-01-17 15:51:21 +0800
committerAntoine GIRARD <sapk@users.noreply.github.com>2020-01-17 08:51:21 +0100
commit9809fe27c41d1a639b2104a046e292215eed3953 (patch)
treebbffb1421addac4f5f818e202b5d2a41bdffb779
parented6a2f2e2ecc4dec4f5a38c8356df98b88331d8a (diff)
downloadgitea-9809fe27c41d1a639b2104a046e292215eed3953.tar.gz
gitea-9809fe27c41d1a639b2104a046e292215eed3953.zip
fix dump non-exist log directory (#9818) (#9820)
Co-authored-by: Lauris BH <lauris@nix.lv>
-rw-r--r--cmd/dump.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd/dump.go b/cmd/dump.go
index 1bf6901769..2de8278a29 100644
--- a/cmd/dump.go
+++ b/cmd/dump.go
@@ -145,8 +145,10 @@ func runDump(ctx *cli.Context) error {
}
}
- if err := z.AddDir("log", setting.LogRootPath); err != nil {
- log.Fatalf("Failed to include log: %v", err)
+ if com.IsExist(setting.LogRootPath) {
+ if err := z.AddDir("log", setting.LogRootPath); err != nil {
+ log.Fatalf("Failed to include log: %v", err)
+ }
}
if err = z.Close(); err != nil {