fastlane-plugin-increment_version_code 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5fd01608c56495ff213e3dfcb09b899b5772b929
4
- data.tar.gz: bda4ab6d62e4c89e09ed086569a706704ed6221c
3
+ metadata.gz: 942861b9287cd69f7e2f2b7126dbd1b9a420d8a5
4
+ data.tar.gz: 3fc6330362b2c1104ead5738cd6ae59696fc90f8
5
5
  SHA512:
6
- metadata.gz: 7b5cf1a01d2e4a4a55e6a93fb94b700aa5e1676745ff4212d34f744c541e4ffce3000bdf9a546c82abdc357b6679c7db5b7a7e36c03c1ec6448cb48b5a56016f
7
- data.tar.gz: 761045e094096def2844fc22467788e598aaa22c3d8590816f60098eee9918330021fae1d96af9e249c0b0105129f3fe6d9c8f29698b3e570da8cffac50ddb9d
6
+ metadata.gz: c67721ca04e16eeff80d53b321e2355ddb0395f33b5e4e621c92b6948e43f415ae2877fb193979eb259b908216999226dd609b15595ab18f37083ca2cdaf5e9d
7
+ data.tar.gz: 8fb65aa1be091d1380a6ff3088c09723834ad17f4074f8a748a2ee34348c6d4cdb3015d8c95991d6420650b4dd2785c8437b3a21755eaa2dc1bd5bb01dde0840
@@ -15,14 +15,16 @@ module Fastlane
15
15
  foundVersionCode = "false"
16
16
  Dir.glob("**/#{app_folder_name}/build.gradle") do |path|
17
17
  UI.message(" -> Found a build.gradle file at path: (#{path})!")
18
- begin
18
+ begin
19
+ temp_file = Tempfile.new('fastlaneIncrementVersionCode')
19
20
  File.open(path, 'r') do |file|
20
21
  file.each_line do |line|
21
22
  if line.include? "versionCode " and foundVersionCode=="false"
23
+
22
24
  versionComponents = line.strip.split(' ')
23
25
  version_code = versionComponents[1].tr("\"","")
24
26
  new_version_code = version_code.to_i + 1
25
- if version_code.is_a? Integer
27
+ if !!(version_code =~ /\A[-+]?[0-9]+\z/)
26
28
  line.replace line.sub(version_code, new_version_code.to_s)
27
29
  foundVersionCode = "true"
28
30
  end
@@ -31,18 +33,25 @@ module Fastlane
31
33
  temp_file.puts line
32
34
  end
33
35
  end
34
- file.close
36
+
35
37
  if foundVersionCode=="true"
36
38
  break
37
39
  end
40
+ file.close
38
41
  end
39
42
  FileUtils.mv(temp_file.path, path)
40
- ensure
41
43
  temp_file.close
42
44
  temp_file.unlink
45
+ ensure
46
+ if foundVersionCode=="true"
47
+
48
+ break
49
+ end
50
+
43
51
  end
44
52
  end
45
53
 
54
+
46
55
  if version_code == "0" || new_version_code == "1"
47
56
  UI.user_error!("Impossible to find the version code in the current project folder #{app_folder_name} 😭")
48
57
  else
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module IncrementVersionCode
3
- VERSION = "0.2.2"
3
+ VERSION = "0.2.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-increment_version_code
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jems
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-02 00:00:00.000000000 Z
11
+ date: 2016-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry