Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nedley committed Dec 24, 2019
1 parent bb76e07 commit 6991733
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
10 changes: 6 additions & 4 deletions cook/Recipes/CreateCertificate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ struct CreateCertificate: ExecutableRecipe {
logger.log(.info, "Certificate already exists, revoking...")
return revoke(cert: cert)
} else {
logger.log(.error, "Certificate already exists! Aborting... (Use -f to force revoke)")
logger.log(.info, "Certificate already exists! Aborting... (Use -f to force revoke)")
return _abort(CertificateError.certificateAlreadyExists)
}
} else {
Expand All @@ -83,10 +83,10 @@ struct CreateCertificate: ExecutableRecipe {
if error.localizedDescription.contains("7460") {
if self.force {
guard let cert = certs.first(where: { $0.name.contains("iPhone Developer") }) else { return _abort(CertificateError.missingCertificate) }
logger.log(.error, "Unable to add certificate, revoking \(cert)...")
logger.log(.info, "Unable to add certificate, revoking \(cert)...")
return revoke(cert: cert)
} else {
logger.log(.error, "Error: You already have a current iOS Development certificate or a pending certificate request. Use -f to force revoke.")
logger.log(.info, "Error: You already have a current iOS Development certificate or a pending certificate request. Use -f to force revoke.")
return _abort(CertificateError.certificateAlreadyExists)
}
} else {
Expand Down Expand Up @@ -143,12 +143,14 @@ struct CreateCertificate: ExecutableRecipe {
switch result {
case .failure(let error as NSError):
return handle(error: error)
case .success(_):
case .success(let certAdded):
let privateKey: Data? = certAdded.privateKey
API.fetchCertificates(team: team, session: session) { result in
switch result {
case .failure(let error): return _abort(error)
case .success(let certs):
guard let cert = certs.first(where: { $0.machineName?.hasPrefix(self.machinePrefix) ?? false }) else { return _abort(CertificateError.missingCertificate) }
cert.privateKey = privateKey
return save(cert: cert)
}
}
Expand Down
2 changes: 1 addition & 1 deletion cook/Recipes/DownloadProvisioningProfiles.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct DownloadProvisioningProfiles: ExecutableRecipe {

switch result {
case .failure(let error):
logger.log(.error, "Failed to download one profile: \(error)")
logger.log(.info, "Failed to download one profile: \(error)")
case .success(let profile):
logger.log(.verbose, "Saving mobileprovision...")
logger.log(.verbose, "Expiration date: \(profile.expirationDate)")
Expand Down
2 changes: 1 addition & 1 deletion cook/Recipes/RegisterBundleId.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ struct RegisterBundleId: ExecutableRecipe {
logger.log(.verbose, "App id removed successfully, resistering...")
return register()
} else {
logger.log(.error, "Failed to delete app id")
logger.log(.info, "Failed to delete app id")
return _abort(AppIdError.failedToDeleteAppId)
}
}
Expand Down
4 changes: 2 additions & 2 deletions cook/Recipes/UpdateProvisioningProfile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ struct UpdateProvisioningProfile: ExecutableRecipe {
}
}
} else {
logger.log(.error, "Failed to delete app id")
logger.log(.info, "Failed to delete app id")
return _abort(AppIdError.failedToDeleteAppId)
}
}
Expand All @@ -99,7 +99,7 @@ struct UpdateProvisioningProfile: ExecutableRecipe {
}
}
} else {
logger.log(.error, "App id with bundle identifier \(self.bundleId) does not exist!")
logger.log(.info, "App id with bundle identifier \(self.bundleId) does not exist!")
return _abort(AppIdError.missingAppId)
}
}
Expand Down

0 comments on commit 6991733

Please sign in to comment.