Skip to content

Commit

Permalink
Empty tempalte name
Browse files Browse the repository at this point in the history
  • Loading branch information
lpusok committed Jan 10, 2023
1 parent 85f35bc commit 5f9cd18
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,27 @@ func parseAuthType(bitriseConnection string) (codesign.AuthType, error) {
}
}

func parseTemplateName(tempalteName string) (map[autocodesign.DistributionType]string, error) {
lines := strings.Split(tempalteName, "\n")
func parseTemplateName(names string) (map[autocodesign.DistributionType]string, error) {
lines := strings.Split(names, "\n")

distributionToTemplate := make(map[autocodesign.DistributionType]string)
for _, line := range lines {
parts := strings.SplitN(line, ":", 2)
if len(parts) < 2 {
return nil, fmt.Errorf("invalid Provisioning Profile template name format (%s), example of expected format: `development: Dev Template`", tempalteName)
if len(parts) < 1 {
return nil, fmt.Errorf("invalid Provisioning Profile template name format (%s), example of expected format: `development: Dev Template\napp-store: Dist Template`", names)
}

distribution := autocodesign.DistributionType(strings.TrimSpace(parts[0]))
templateName := strings.TrimSpace(parts[1])
if len(parts) == 1 {
continue
}

templateName := strings.TrimSpace(parts[1])
if templateName == "" {
continue
}

distributionToTemplate[distribution] = tempalteName
distributionToTemplate[distribution] = templateName
}

return distributionToTemplate, nil
Expand Down

0 comments on commit 5f9cd18

Please sign in to comment.