forked from forgejo/forgejo
Backport #26346
Follow the CLI refactoring, and add tests.
(cherry picked from commit fa431b377d
)
This commit is contained in:
parent
149cd865ea
commit
2e539d5190
4 changed files with 104 additions and 4 deletions
8
main.go
8
main.go
|
@ -192,11 +192,11 @@ argument - which can alternatively be run by running the subcommand web.`
|
|||
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()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue