forked from StackExchange/dnscontrol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
38 lines (33 loc) · 1.13 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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"
)
//go:generate go run build/generate/generate.go build/generate/featureMatrix.go build/generate/functionTypes.go build/generate/dtsFile.go
// 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.
var (
SHA = ""
Version = ""
BuildTime = ""
)
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()))
}