gogs.go 809 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //go:build go1.14
  2. // +build go1.14
  3. // Copyright 2014 The Gogs Authors. All rights reserved.
  4. // Use of this source code is governed by a MIT-style
  5. // license that can be found in the LICENSE file.
  6. // Gogs is a painless self-hosted Git Service.
  7. package main
  8. import (
  9. "os"
  10. "github.com/urfave/cli"
  11. log "unknwon.dev/clog/v2"
  12. "gogs.io/gogs/internal/cmd"
  13. "gogs.io/gogs/internal/conf"
  14. )
  15. func init() {
  16. conf.App.Version = "0.12.11"
  17. }
  18. func main() {
  19. app := cli.NewApp()
  20. app.Name = "Gogs"
  21. app.Usage = "A painless self-hosted Git service"
  22. app.Version = conf.App.Version
  23. app.Commands = []cli.Command{
  24. cmd.Web,
  25. cmd.Serv,
  26. cmd.Hook,
  27. cmd.Cert,
  28. cmd.Admin,
  29. cmd.Import,
  30. cmd.Backup,
  31. cmd.Restore,
  32. }
  33. if err := app.Run(os.Args); err != nil {
  34. log.Fatal("Failed to start application: %v", err)
  35. }
  36. }