Add goreleaser tags to build
This commit is contained in:
parent
dd001963b2
commit
03580ac113
@ -5,15 +5,37 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
"runtime/debug"
|
||||||
|
|
||||||
fetcherv1 "gitlab.com/fat0troll/uploader_tools/domains/fetcher/v1"
|
fetcherv1 "gitlab.com/fat0troll/uploader_tools/domains/fetcher/v1"
|
||||||
loginerv1 "gitlab.com/fat0troll/uploader_tools/domains/loginer/v1"
|
loginerv1 "gitlab.com/fat0troll/uploader_tools/domains/loginer/v1"
|
||||||
"gitlab.com/fat0troll/uploader_tools/internal/context"
|
"gitlab.com/fat0troll/uploader_tools/internal/context"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// In production builds these variables are set by goreleaser
|
||||||
|
var (
|
||||||
|
version = "master"
|
||||||
|
commit = "?"
|
||||||
|
date = ""
|
||||||
|
)
|
||||||
|
|
||||||
|
//nolint:gochecknoinits
|
||||||
|
func init() {
|
||||||
|
if info, available := debug.ReadBuildInfo(); available {
|
||||||
|
if date == "" && info.Main.Version != "(devel)" {
|
||||||
|
version = info.Main.Version
|
||||||
|
commit = fmt.Sprintf("(unknown, mod sum: %q)", info.Main.Sum)
|
||||||
|
date = "(unknown)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
c := context.New()
|
c := context.New()
|
||||||
c.Init()
|
c.Init()
|
||||||
c.Logger.Info().Msg("Загрузчик торрентов из разделов NNM-Club начинает свою работу")
|
c.Logger.Info().Str("версия", version).Str("коммит", commit).Str("дата сборки", date).
|
||||||
|
Msg("Загрузчик торрентов из разделов NNM-Club начинает свою работу")
|
||||||
c.InitConfig()
|
c.InitConfig()
|
||||||
|
|
||||||
loginerv1.New(c)
|
loginerv1.New(c)
|
||||||
|
Loading…
Reference in New Issue
Block a user