mirror of
https://github.com/go-gitea/gitea
synced 2025-08-09 11:08:19 +00:00
Backport #26346 Follow the CLI refactoring, and add tests.
This commit is contained in:
8
main.go
8
main.go
@@ -146,11 +146,11 @@ func main() {
|
||||
app.Commands = append(app.Commands, subCmdWithIni...)
|
||||
app.Commands = append(app.Commands, subCmdStandalone...)
|
||||
|
||||
err := app.Run(os.Args)
|
||||
if err != nil {
|
||||
_, _ = fmt.Fprintf(app.Writer, "\nFailed to run with %s: %v\n", os.Args, err)
|
||||
cli.OsExiter = func(code int) {
|
||||
log.GetManager().Close()
|
||||
os.Exit(code)
|
||||
}
|
||||
|
||||
_ = cmd.RunMainApp(app, os.Args...) // all errors should have been handled by the RunMainApp
|
||||
log.GetManager().Close()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user