2016-08-23 08:31:50 +08:00
package main
import (
"fmt"
2017-09-15 21:59:43 +08:00
"os"
2020-10-10 22:34:04 +08:00
"runtime/debug"
2016-08-23 08:31:50 +08:00
2023-05-21 01:21:45 +08:00
"github.com/StackExchange/dnscontrol/v4/commands"
_ "github.com/StackExchange/dnscontrol/v4/providers/_all"
2023-02-19 23:54:53 +08:00
"github.com/fatih/color"
2016-08-23 08:31:50 +08:00
)
2024-07-11 03:53:50 +08:00
//go:generate go run build/generate/generate.go build/generate/featureMatrix.go build/generate/functionTypes.go build/generate/dtsFile.go build/generate/ownersFile.go
2016-08-23 08:31:50 +08:00
2020-10-13 00:54:40 +08:00
// 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.
2024-01-04 23:46:36 +08:00
// GoReleaser: version
2020-10-13 00:54:40 +08:00
var (
2024-01-04 23:46:36 +08:00
version = "dev"
2020-10-13 00:54:40 +08:00
)
2016-08-23 08:31:50 +08:00
func main ( ) {
2023-02-19 23:54:53 +08:00
if os . Getenv ( "CI" ) == "true" {
color . NoColor = false
}
2020-10-10 22:34:04 +08:00
if info , ok := debug . ReadBuildInfo ( ) ; ! ok && info == nil {
2023-01-20 20:56:20 +08:00
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" )
2020-10-10 22:34:04 +08:00
}
2024-01-07 22:39:53 +08:00
os . Exit ( commands . Run ( "DNSControl version " + version ) )
2016-08-23 08:31:50 +08:00
}