-
Notifications
You must be signed in to change notification settings - Fork 19
/
main.go
31 lines (23 loc) · 897 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
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package main
import (
"github.com/charmbracelet/log"
"github.com/sailpoint-oss/sailpoint-cli/cmd/root"
"github.com/sailpoint-oss/sailpoint-cli/internal/config"
"github.com/spf13/cobra"
)
var rootCmd *cobra.Command
func init() {
cobra.CheckErr(config.InitConfig())
rootCmd = root.NewRootCommand()
}
// main the entry point for commands. Note that we do not need to do cobra.CheckErr(err)
// here. When a command returns error, cobra already logs it. Adding CheckErr here will
// cause error messages to be logged twice. We do need to exit with error code if something
// goes wrong. This will exit the cli container during pipeline build and fail that stage.
func main() {
_ = rootCmd.Execute()
if saveErr := config.SaveConfig(); saveErr != nil {
log.Warn("Issue saving config file", "error", saveErr)
}
}