Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion cmd/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,9 @@ Would you like to use this team to sign your project?`, archiveCertificate.TeamI
if !useArchiveTeam {
teams := []string{}
for team := range certificatesByTeam {
teams = append(teams, team)
if teamHasCertificates(archiveCertificate, certificatesByTeam[team]) {
teams = append(teams, team)
}
}

fmt.Println()
Expand Down Expand Up @@ -867,6 +869,20 @@ func UploadIdentity(bitriseClient *bitriseclient.BitriseClient, outputDirPath st
return bitriseClient.ConfirmIdentityUpload(certificateResponseData.Slug, certificateResponseData.UploadFileName)
}

func teamHasCertificates(archiveCertificate certificateutil.CertificateInfoModel, certificates []certificateutil.CertificateInfoModel) bool {
if isDistributionCertificate(archiveCertificate) {
developmentCertificates := certificateutil.FilterCertificateInfoModelsByFilterFunc(certificates, func(certInfo certificateutil.CertificateInfoModel) bool {
return !isDistributionCertificate(certInfo)
})
return len(developmentCertificates) > 0
}

distributionCertificates := certificateutil.FilterCertificateInfoModelsByFilterFunc(certificates, func(certInfo certificateutil.CertificateInfoModel) bool {
return isDistributionCertificate(certInfo)
})
return len(distributionCertificates) > 0
}

func askAccessToken() (token string, err error) {
messageToAsk := `Please copy your personal access token to Bitrise.
(To acquire a Personal Access Token for your user, sign in with that user on bitrise.io, go to your Account Settings page,
Expand Down