@@ -38,9 +38,9 @@ func NewEnvListCommand(clients *shared.ClientFactory) *cobra.Command {
3838 "List environment variables available to the app at runtime." ,
3939 "" ,
4040 "Commands that run in the context of a project source environment variables from" ,
41- " the \ " .env\ " file. This includes the \ " run\ " command." ,
41+ ` the ".env" file. This includes the "run" command.` ,
4242 "" ,
43- " The \ " deploy\ " command gathers environment variables from the \ " .env\ " file as well" ,
43+ ` The "deploy" command gathers environment variables from the ".env" file as well` ,
4444 "unless the app is using ROSI features." ,
4545 }, "\n " ),
4646 Example : style .ExampleCommandsf ([]style.ExampleCommand {
@@ -115,36 +115,28 @@ func runEnvListCommandFunc(
115115
116116 count := len (variableNames )
117117 clients .IO .PrintTrace (ctx , slacktrace .EnvListCount , strconv .Itoa (count ))
118- clients .IO .PrintInfo (ctx , false , "\n %s" , style .Sectionf (style.TextSection {
119- Emoji : "evergreen_tree" ,
120- Text : "App Environment" ,
121- Secondary : []string {
122- fmt .Sprintf (
123- "There %s %d %s stored in this environment" ,
124- style .Pluralize ("is" , "are" , count ),
125- count ,
126- style .Pluralize ("variable" , "variables" , count ),
127- ),
128- },
129- }))
130118
131- if count <= 0 {
132- return nil
119+ details := []string {
120+ fmt .Sprintf (
121+ "There %s %d %s stored in this environment" ,
122+ style .Pluralize ("is" , "are" , count ),
123+ count ,
124+ style .Pluralize ("variable" , "variables" , count ),
125+ ),
133126 }
134127
135- sort .Strings (variableNames )
136- variableLabels := make ([]string , 0 , count )
137- for _ , v := range variableNames {
138- variableLabels = append (
139- variableLabels ,
140- fmt .Sprintf ("%s: %s" , v , style .Secondary ("***" )),
141- )
128+ if count > 0 {
129+ sort .Strings (variableNames )
130+ for _ , v := range variableNames {
131+ details = append (details , fmt .Sprintf ("- %s: %s" , v , style .Secondary ("***" )))
132+ }
133+ clients .IO .PrintTrace (ctx , slacktrace .EnvListVariables , variableNames ... )
142134 }
143- clients . IO . PrintTrace ( ctx , slacktrace . EnvListVariables , variableNames ... )
144- clients .IO .PrintInfo (ctx , false , "%s" , style .Sectionf (style.TextSection {
135+
136+ clients .IO .PrintInfo (ctx , false , "\n %s" , style .Sectionf (style.TextSection {
145137 Emoji : "evergreen_tree" ,
146- Text : "App Environment" ,
147- Secondary : variableLabels ,
138+ Text : "Environment List " ,
139+ Secondary : details ,
148140 }))
149141
150142 return nil
0 commit comments