fastlane-plugin-fivethree_ionic 0.1.0 → 0.1.1

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: 7cf3fb5b5eeec37fc8f2662067af6810b047bff8
4
- data.tar.gz: 5aa9af21f605f837583d2e6f9e9f50868fd6cea7
3
+ metadata.gz: 1282694113bf998748a2fe0d5f498dc13cac10ca
4
+ data.tar.gz: '085330210e92e21e319b71c61b76800cc7af594d'
5
5
  SHA512:
6
- metadata.gz: aef544ea34d13c07ea876c54032c023110003539256e865064115614199ccb56844dce4806bfda744b4be1dcda65b565a01aa7d656b70c12fe7eaf8729cf3908
7
- data.tar.gz: 48bcd467e9783105fb5296226d92a85804fc5a7ff7b094a7d7645a1e8d8ebcde21ebfa6b6b62293437ffb5f1745c291d24956b190b734293a34a2fc6ef6d3fcd
6
+ metadata.gz: 4a96ad29f059bcef1a97b570b6aa292c544d036cead14afe5103f792c5c271d5e739236739d3ff5014a47d94fbb0bfb011d8b57e5e12b618d2567b67600b32d0
7
+ data.tar.gz: 84e90567187b22299f5c6d2c872be1bfe20ffbec73b3675cc380dc66f1abf74242ea02a8085a949466c7e391d1b5a3e0ad5d563450b762ec0fa08399a2d87beb
@@ -7,11 +7,31 @@ module Fastlane
7
7
  class FivUpdateVersionAction < Action
8
8
  def self.run(params)
9
9
  # fastlane will take care of reading in the parameter and fetching the environment variable:
10
- UI.message "Parameter API Token: #{params[:api_token]}"
10
+ old_version = sh "echo \"cat //*[local-name()='widget']/@version\" | xmllint --shell #{params[:pathToConfigXML]}| awk -F'[=\"]' '!/>/{print $(NF-1)}'"
11
+ old_version = old_version.delete!("\n")
12
+ puts "current version: #{old_version}"
11
13
 
12
- # sh "shellcommand ./path"
14
+ puts "Insert new version number, current version in config.xml is '#{old_version}' (Leave empty and press enter to skip this step): "
15
+ new_version_number = STDIN.gets.strip
16
+ puts "new version: #{new_version_number}"
17
+
18
+ if new_version_number.length > 0
19
+ puts "take new version number"
20
+ version = new_version_number
21
+ else
22
+ puts "take old version number"
23
+ version = old_version
24
+ end
25
+
26
+ text = File.read(params[:pathToConfigXML])
27
+
28
+ new_contents = text
29
+ .gsub(/version="[0-9.]*"/, "version=\"#{version}\"")
30
+
31
+ File.open(params[:pathToConfigXML], "w") {|file| file.puts new_contents}
32
+
33
+ return version
13
34
 
14
- # Actions.lane_context[SharedValues::FIV_UPDATE_VERSION_CUSTOM_VALUE] = "my_val"
15
35
  end
16
36
 
17
37
  #####################################################
@@ -31,20 +51,15 @@ module Fastlane
31
51
  def self.available_options
32
52
  # Define all options your action supports.
33
53
 
34
- # Below a few examples
35
54
  [
36
- FastlaneCore::ConfigItem.new(key: :api_token,
37
- env_name: "FL_FIV_UPDATE_VERSION_API_TOKEN", # The name of the environment variable
38
- description: "API Token for FivUpdateVersionAction", # a short description of this parameter
39
- verify_block: proc do |value|
40
- UI.user_error!("No API token for FivUpdateVersionAction given, pass using `api_token: 'token'`") unless (value and not value.empty?)
41
- # UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
42
- end),
43
- FastlaneCore::ConfigItem.new(key: :development,
44
- env_name: "FL_FIV_UPDATE_VERSION_DEVELOPMENT",
45
- description: "Create a development certificate instead of a distribution one",
46
- is_string: false, # true: verifies the input is a string, false: every kind of value
47
- default_value: false) # the default value if the user didn't provide one
55
+ FastlaneCore::ConfigItem.new(key: :pathToConfigXML,
56
+ env_name: "FIV_INCREMENT_BUILD_CONFIG",
57
+ description: "---",
58
+ optional: false,
59
+ verify_block: proc do | value |
60
+ UI.user_error!("Couldnt find config.xml! Please change your path.") unless File.exist?(value)
61
+ end ,
62
+ type: String)
48
63
  ]
49
64
  end
50
65
 
@@ -57,7 +72,7 @@ module Fastlane
57
72
  end
58
73
 
59
74
  def self.return_value
60
- # If your method provides a return value, you can describe here what it does
75
+ "returns the new version specified in config.xml"
61
76
  end
62
77
 
63
78
  def self.authors
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module FivethreeIonic
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-fivethree_ionic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc Stammerjohann