We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e44abf3 commit be72d8eCopy full SHA for be72d8e
pkg/cmd/version/version.go
@@ -29,7 +29,12 @@ var VersionCmd = &cobra.Command{
29
Short: "Displays the version of litmusctl",
30
Long: ``,
31
Run: func(cmd *cobra.Command, args []string) {
32
- compatibilityArr := utils.CompatibilityMatrix[os.Getenv("CLIVersion")]
+ cliVersion := os.Getenv("CLIVersion")
33
+ if cliVersion == "" {
34
+ utils.Red.Println("Error: CLIVersion environment variable is not set.")
35
+ return
36
+ }
37
+ compatibilityArr := utils.CompatibilityMatrix[cliVersion]
38
utils.White_B.Println("Litmusctl version: ", os.Getenv("CLIVersion"))
39
utils.White_B.Println("Compatible ChaosCenter versions: ")
40
utils.White_B.Print("[ ")
0 commit comments