-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
50 lines (43 loc) · 775 Bytes
/
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
39
40
41
42
43
44
45
46
47
48
49
50
package main
import (
"fmt"
"os"
"github.com/mheers/k3dnifi/cmd"
"github.com/mheers/k3dnifi/nifi"
"github.com/mheers/k3droot/helpers"
"github.com/sirupsen/logrus"
)
// build flags
var (
VERSION string
BuildTime string
CommitHash string
GoVersion string
GitTag string
GitBranch string
)
func main() {
_, err := nifi.Init()
if err != nil {
panic(err)
}
k3d, err := helpers.IsK3d()
if err != nil {
panic(err)
}
if !k3d {
fmt.Println("Not a k3d cluster")
os.Exit(1)
}
cmd.VERSION = VERSION
cmd.BuildTime = BuildTime
cmd.CommitHash = CommitHash
cmd.GoVersion = GoVersion
cmd.GitTag = GitTag
cmd.GitBranch = GitBranch
// execeute the command
err = cmd.Execute()
if err != nil {
logrus.Fatalf("Execute failed: %+v", err)
}
}