cert 1.2.4 → 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3a21bec125056ef7486f17c9fa88749961cd2b6c
4
- data.tar.gz: 9b06c932b5fccc27d7daffd954c3dad74671a365
3
+ metadata.gz: 1831bb359ed6c1f3e5fe6b77e394799b7bdfa4b2
4
+ data.tar.gz: b45082955557faf8c8818783c5919a52b224e7b9
5
5
  SHA512:
6
- metadata.gz: a074205a27921338d54f6edebaa419cc24ca3fdd8818707ea48c10ad8bd5039dccc9ce7ace94a2dccbb5fa1cfcb5afd873184abc44b9d431f4de2a257ec5b63d
7
- data.tar.gz: eabd7756c809182b147c2d65d4eefb3f512c01e3e857d0574730a47827b3b7f35e1706fb1309b1f1c8f689d5a7a862f194d2d398e7e89886be5ea179280cdfc5
6
+ metadata.gz: 475de97f8332c9eb82e78297f001f2dc1aa1f6b4941d563812bb5ddc931269516b48ad6ffb6f137289228eb50fade8993d6192f738d3f647b6f95701b4798580
7
+ data.tar.gz: 3faf4477d503da1d5c790df85b7e060c087eb5ae3f52d8c5a5cd3f0b897c5f9751ebe999df959fcbb85dc32b57f5d36d7c442d507997edb49e5ac96971993b10
@@ -19,13 +19,18 @@ module Cert
19
19
  Spaceship.select_team
20
20
  Helper.log.info "Successfully logged in"
21
21
 
22
- cert_path = find_existing_cert
23
- if cert_path.nil? || Cert.config[:force]
24
- if create_certificate # no certificate here, creating a new one
25
- return # success
26
- else
27
- raise "Something went wrong when trying to create a new certificate..."
28
- end
22
+ should_create = Cert.config[:force]
23
+ unless should_create
24
+ cert_path = find_existing_cert
25
+ should_create = cert_path.nil?
26
+ end
27
+
28
+ return unless should_create
29
+
30
+ if create_certificate # no certificate here, creating a new one
31
+ return # success
32
+ else
33
+ raise "Something went wrong when trying to create a new certificate..."
29
34
  end
30
35
  end
31
36
 
@@ -42,7 +47,6 @@ module Cert
42
47
  Helper.log.info "Found the certificate #{certificate.id} (#{certificate.name}) which is installed on the local machine. Using this one.".green
43
48
 
44
49
  return path
45
-
46
50
  elsif File.exist?(private_key_path)
47
51
  KeychainImporter.import_file(private_key_path)
48
52
  KeychainImporter.import_file(path)
@@ -53,10 +57,11 @@ module Cert
53
57
  Helper.log.info "Found the cached certificate #{certificate.id} (#{certificate.name}). Using this one.".green
54
58
 
55
59
  return path
56
-
57
60
  else
58
61
  Helper.log.info "Certificate #{certificate.id} (#{certificate.name}) can't be found on your local computer"
59
62
  end
63
+
64
+ File.delete(path) # as apparantly this certificate is pretty useless without a private key
60
65
  end
61
66
 
62
67
  Helper.log.info "Couldn't find an existing certificate... creating a new one"
@@ -85,7 +90,10 @@ module Cert
85
90
  begin
86
91
  certificate = certificate_type.create!(csr: csr)
87
92
  rescue => ex
88
- Helper.log.error "Could not create another certificate, reached the maximum number of available certificates.".red
93
+ if ex.to_s.include?("You already have a current")
94
+ Helper.log.error "Could not create another certificate, reached the maximum number of available certificates.".red
95
+ end
96
+
89
97
  raise ex
90
98
  end
91
99
 
@@ -1,3 +1,3 @@
1
1
  module Cert
2
- VERSION = "1.2.4"
2
+ VERSION = "1.2.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cert
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-01 00:00:00.000000000 Z
11
+ date: 2015-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastlane_core