litmuschaos / litmusctl

Command-Line tool to manage Litmuschaos's agent plane
Apache License 2.0
24 stars 46 forks source link

litmusctl version command shows empty output for local setup #181

Closed shivam-Purohit closed 9 months ago

shivam-Purohit commented 10 months ago

how to reproduce:

  1. clone the repository
  2. build the binary
  3. move to the binary to local bin folder
  4. use command litmusctl version

possible reasons In the version command defined under pkg/cmd/version/version.go it uses the environment variables to extract the litmusctl version. As I checked further the environment variable CLIversion is set under the main.go file. Which relies on the build process to get the version, which is not what we do for local setup.

possible solution For now i think we should simply add a check if the version is set in the environment rather than giving an empty output. golang doesn't throw any error as it supports variables without explicitly initialising them. I will add that check but I am confused about the version information in the local.

SarthakJain26 commented 9 months ago

Fixed with #182