Files
MokoGitea/main.go
T
Jonathan Miller c572fcfe04
PR RC Release / Build RC Release (pull_request) Failing after 0s
Branch Policy Check / Verify merge target (pull_request) Failing after 0s
chore(core): rename Go module from code.gitea.io/gitea to MokoGitea namespace
Rename the Go module path from code.gitea.io/gitea to
git.mokoconsulting.tech/MokoConsulting/MokoGitea across the entire
codebase.

Scope:
- go.mod module declaration
- 2,235 Go source files (import paths)
- Dockerfile WORKDIR and COPY paths
- Swagger API templates
- golangci.yml linter config

External dependencies (code.gitea.io/gitea-vet, code.gitea.io/sdk/gitea,
gitea.com/gitea/act, etc.) are intentionally NOT renamed — they are
separate upstream modules.

Closes #132

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-25 00:22:38 -05:00

58 lines
1.7 KiB
Go

// Copyright 2014 The Gogs Authors. All rights reserved.
// Copyright 2016 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package main
import (
"os"
"runtime"
"strings"
"time"
"git.mokoconsulting.tech/MokoConsulting/MokoGitea/cmd"
"git.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/log"
"git.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/setting"
// register supported doc types
_ "git.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/markup/asciicast"
_ "git.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/markup/console"
_ "git.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/markup/csv"
_ "git.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/markup/markdown"
_ "git.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/markup/orgmode"
"github.com/urfave/cli/v3"
)
// these flags will be set by the build flags
var (
Version = "development" // program version for this build
Tags = "" // the Golang build tags
)
func init() {
setting.AppVer = Version
setting.AppBuiltWith = formatBuiltWith()
setting.AppStartTime = time.Now().UTC()
}
func main() {
cli.OsExiter = func(code int) {
log.GetManager().Close()
os.Exit(code)
}
app := cmd.NewMainApp(cmd.AppVersion{Version: Version, Extra: formatBuiltWith()})
_ = cmd.RunMainApp(app, os.Args...) // all errors should have been handled by the RunMainApp
// flush the queued logs before exiting, it is a MUST, otherwise there will be log loss
log.GetManager().Close()
}
func formatBuiltWith() string {
version := runtime.Version()
if len(Tags) == 0 {
return " built with " + version
}
return " built with " + version + " : " + strings.ReplaceAll(Tags, " ", ", ")
}