File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -97,10 +97,6 @@ var _envListCmd = &cobra.Command{
9797 }
9898
9999 if _flagOutput == flags .JSONOutputType {
100- if len (cliConfig .Environments ) == 0 {
101- fmt .Print ("[]" )
102- return
103- }
104100 bytes , err := libjson .Marshal (cliConfig .ConvertToUserFacingCLIConfig ())
105101 if err != nil {
106102 exit .Error (err )
Original file line number Diff line number Diff line change @@ -57,8 +57,12 @@ func (cliConfig *CLIConfig) Validate() error {
5757}
5858
5959func (cliConfig * CLIConfig ) ConvertToUserFacingCLIConfig () UserFacingCLIConfig {
60+ envs := cliConfig .Environments
61+ if envs == nil {
62+ envs = []* Environment {}
63+ }
6064 return UserFacingCLIConfig {
6165 DefaultEnvironment : cliConfig .DefaultEnvironment ,
62- Environments : cliConfig . Environments ,
66+ Environments : envs ,
6367 }
6468}
You can’t perform that action at this time.
0 commit comments