Skip to content

Commit 23a288f

Browse files
committed
add doctor
1 parent f2e6c45 commit 23a288f

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

cmd/doctor.go

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright 2019 The Gitea Authors. All rights reserved.
2+
// Use of this source code is governed by a MIT-style
3+
// license that can be found in the LICENSE file.
4+
5+
package cmd
6+
7+
import (
8+
"github.com/urfave/cli"
9+
10+
"code.gitea.io/gitea/modules/setting"
11+
)
12+
13+
// CmdDoctor represents the available doctor sub-command.
14+
var CmdDoctor = cli.Command{
15+
Name: "doctor",
16+
Usage: "Diagnose the problems",
17+
Description: "A command to diagnose the problems of current gitea instance according the given configuration.",
18+
Action: runDoctor,
19+
}
20+
21+
func runDoctor(ctx *cli.Context) error {
22+
if err := initDB(); err != nil {
23+
return err
24+
}
25+
26+
runDoctorLocationMoved(ctx)
27+
}
28+
29+
func runDoctorLocationMoved(ctx *cliContext) {
30+
setting.RepoRootPath
31+
}

0 commit comments

Comments
 (0)