2022-08-08 13:56:50 +08:00
|
|
|
//go:build go1.17
|
|
|
|
|
// +build go1.17
|
2014-04-13 03:14:43 -04:00
|
|
|
|
2014-02-19 13:04:31 -05:00
|
|
|
// Copyright 2014 The Gogs Authors. All rights reserved.
|
|
|
|
|
// Use of this source code is governed by a MIT-style
|
|
|
|
|
// license that can be found in the LICENSE file.
|
2014-02-19 17:50:53 +08:00
|
|
|
|
2017-02-15 22:29:31 -05:00
|
|
|
// Gogs is a painless self-hosted Git Service.
|
2014-02-12 12:49:46 -05:00
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
2014-02-19 17:50:53 +08:00
|
|
|
"os"
|
2014-02-12 12:49:46 -05:00
|
|
|
|
2016-08-30 13:57:58 +02:00
|
|
|
"github.com/urfave/cli"
|
2020-02-20 02:25:02 +08:00
|
|
|
log "unknwon.dev/clog/v2"
|
2014-03-10 20:53:30 -04:00
|
|
|
|
2019-10-24 01:51:46 -07:00
|
|
|
"gogs.io/gogs/internal/cmd"
|
2020-02-22 09:05:26 +08:00
|
|
|
"gogs.io/gogs/internal/conf"
|
2014-02-12 12:49:46 -05:00
|
|
|
)
|
|
|
|
|
|
2014-02-12 14:54:09 -05:00
|
|
|
func init() {
|
2020-08-22 21:36:28 +08:00
|
|
|
conf.App.Version = "0.13.0+dev"
|
2014-02-12 14:54:09 -05:00
|
|
|
}
|
|
|
|
|
|
2014-02-12 12:49:46 -05:00
|
|
|
func main() {
|
2014-02-19 17:50:53 +08:00
|
|
|
app := cli.NewApp()
|
2014-02-19 13:04:31 -05:00
|
|
|
app.Name = "Gogs"
|
2017-02-15 22:29:31 -05:00
|
|
|
app.Usage = "A painless self-hosted Git service"
|
2020-02-22 09:05:26 +08:00
|
|
|
app.Version = conf.App.Version
|
2014-02-19 17:50:53 +08:00
|
|
|
app.Commands = []cli.Command{
|
2017-02-23 19:59:39 -05:00
|
|
|
cmd.Web,
|
2017-02-14 16:22:16 -05:00
|
|
|
cmd.Serv,
|
2017-02-23 19:59:39 -05:00
|
|
|
cmd.Hook,
|
|
|
|
|
cmd.Cert,
|
|
|
|
|
cmd.Admin,
|
|
|
|
|
cmd.Import,
|
2017-02-26 04:37:05 -05:00
|
|
|
cmd.Backup,
|
|
|
|
|
cmd.Restore,
|
2014-02-19 17:50:53 +08:00
|
|
|
}
|
2019-10-26 01:48:19 -07:00
|
|
|
if err := app.Run(os.Args); err != nil {
|
2020-02-20 02:25:02 +08:00
|
|
|
log.Fatal("Failed to start application: %v", err)
|
2019-10-26 01:48:19 -07:00
|
|
|
}
|
2014-02-12 12:49:46 -05:00
|
|
|
}
|