mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
CICD: GoReleaser version (#2737)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
This commit is contained in:
committed by
GitHub
parent
8ed137aff5
commit
17da0bc69f
13
main.go
13
main.go
@ -2,12 +2,10 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"runtime/debug"
|
||||
|
||||
"github.com/StackExchange/dnscontrol/v4/commands"
|
||||
"github.com/StackExchange/dnscontrol/v4/pkg/version"
|
||||
_ "github.com/StackExchange/dnscontrol/v4/providers/_all"
|
||||
"github.com/fatih/color"
|
||||
)
|
||||
@ -17,22 +15,17 @@ import (
|
||||
// Version management. Goals:
|
||||
// 1. Someone who just does "go get" has at least some information.
|
||||
// 2. If built with build/build.go, more specific build information gets put in.
|
||||
// GoReleaser: version
|
||||
var (
|
||||
SHA = ""
|
||||
Version = ""
|
||||
BuildTime = ""
|
||||
version = "dev"
|
||||
)
|
||||
|
||||
func main() {
|
||||
version.SHA = SHA
|
||||
version.Semver = Version
|
||||
version.BuildTime = BuildTime
|
||||
if os.Getenv("CI") == "true" {
|
||||
color.NoColor = false
|
||||
}
|
||||
log.SetFlags(log.LstdFlags | log.Lshortfile)
|
||||
if info, ok := debug.ReadBuildInfo(); !ok && info == nil {
|
||||
fmt.Fprint(os.Stderr, "Warning: dnscontrol was built without Go modules. See https://docs.dnscontrol.org/getting-started/getting-started#source for more information on how to build dnscontrol correctly.\n\n")
|
||||
}
|
||||
os.Exit(commands.Run("dnscontrol " + version.Banner()))
|
||||
os.Exit(commands.Run("DNSControl " + version))
|
||||
}
|
||||
|
Reference in New Issue
Block a user