You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
app.Description=`By default, Gitea will start serving using the web-server with no argument, which can alternatively be run by running the subcommand "web".`
Copy file name to clipboardExpand all lines: main.go
+7-11
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,6 @@
5
5
package main
6
6
7
7
import (
8
-
"fmt"
9
8
"os"
10
9
"runtime"
11
10
"strings"
@@ -21,6 +20,8 @@ import (
21
20
_ "code.gitea.io/gitea/modules/markup/csv"
22
21
_ "code.gitea.io/gitea/modules/markup/markdown"
23
22
_ "code.gitea.io/gitea/modules/markup/orgmode"
23
+
24
+
"github.com/urfave/cli/v2"
24
25
)
25
26
26
27
// these flags will be set by the build flags
@@ -37,17 +38,12 @@ func init() {
37
38
}
38
39
39
40
funcmain() {
40
-
app:=cmd.NewMainApp()
41
-
app.Name="Gitea"
42
-
app.Usage="A painless self-hosted Git service"
43
-
app.Description=`By default, Gitea will start serving using the web-server with no argument, which can alternatively be run by running the subcommand "web".`
44
-
app.Version=Version+formatBuiltWith()
45
-
46
-
err:=app.Run(os.Args)
47
-
iferr!=nil {
48
-
_, _=fmt.Fprintf(app.Writer, "\nFailed to run with %s: %v\n", os.Args, err)
41
+
cli.OsExiter=func(codeint) {
42
+
log.GetManager().Close()
43
+
os.Exit(code)
49
44
}
50
-
45
+
app:=cmd.NewMainApp(Version, formatBuiltWith())
46
+
_=cmd.RunMainApp(app, os.Args...) // all errors should have been handled by the RunMainApp
0 commit comments