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{
97
97
}
98
98
99
99
if _flagOutput == flags .JSONOutputType {
100
- if len (cliConfig .Environments ) == 0 {
101
- fmt .Print ("[]" )
102
- return
103
- }
104
100
bytes , err := libjson .Marshal (cliConfig .ConvertToUserFacingCLIConfig ())
105
101
if err != nil {
106
102
exit .Error (err )
Original file line number Diff line number Diff line change @@ -57,8 +57,12 @@ func (cliConfig *CLIConfig) Validate() error {
57
57
}
58
58
59
59
func (cliConfig * CLIConfig ) ConvertToUserFacingCLIConfig () UserFacingCLIConfig {
60
+ envs := cliConfig .Environments
61
+ if envs == nil {
62
+ envs = []* Environment {}
63
+ }
60
64
return UserFacingCLIConfig {
61
65
DefaultEnvironment : cliConfig .DefaultEnvironment ,
62
- Environments : cliConfig . Environments ,
66
+ Environments : envs ,
63
67
}
64
68
}
You can’t perform that action at this time.
0 commit comments