mirror of
https://github.com/LukeHagar/sailpoint-cli.git
synced 2025-12-06 04:21:15 +00:00
* 🪵 Implemented an Improved Global logger solution * 🥈 Removed duplicate APIClient inits * 🐛 Corrected an issue with the payload for spconfig import * 🚤 Significantly improved the Speed of Parsing log files with sail va parse * 🎢 Improved error handling for all VA commands * 💻 Added a VA List Command, along with Get and Set commands for VA Log Config
36 lines
934 B
Go
36 lines
934 B
Go
// 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.NewRootCmd()
|
|
|
|
}
|
|
|
|
// 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() {
|
|
|
|
err := rootCmd.Execute()
|
|
|
|
if saveErr := config.SaveConfig(); saveErr != nil {
|
|
log.Warn("Issue saving config file", "error", saveErr)
|
|
}
|
|
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
}
|