Use proj description when there's no template desc (#2179)

Whenever we need to display a template description, if the Pulumi.yaml
doesn't have it, but has a project description, just use the project
description. This will allow us to avoid having the same description for
both the project and template in our examples.
This commit is contained in:
Justin Van Patten 2018-11-08 10:42:26 -08:00 committed by GitHub
parent e1d1366f3b
commit d3ec63cd1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -800,7 +800,8 @@ func templatesToOptionArrayAndMap(templates []workspace.Template) ([]string, map
nameToTemplateMap := make(map[string]workspace.Template)
for _, template := range templates {
// Create the option string that combines the name, padding, and description.
option := fmt.Sprintf(fmt.Sprintf("%%%ds %%s", -maxNameLength), template.Name, template.Description)
desc := workspace.ValueOrDefaultProjectDescription("", template.ProjectDescription, template.Description)
option := fmt.Sprintf(fmt.Sprintf("%%%ds %%s", -maxNameLength), template.Name, desc)
// Add it to the array and map.
options = append(options, option)