Class: Fastlane::Actions::IosUpdateMetadataSourceAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::IosUpdateMetadataSourceAction
- Defined in:
- lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata_source.rb
Documentation collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .output ⇒ Object
- .return_value ⇒ Object
Class Method Summary collapse
Class Method Details
.authors ⇒ Object
71 72 73 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata_source.rb', line 71 def self. ['Automattic'] end |
.available_options ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata_source.rb', line 36 def self. # Define all options your action supports. # Below a few examples [ FastlaneCore::ConfigItem.new(key: :po_file_path, env_name: 'FL_IOS_UPDATE_METADATA_SOURCE_PO_FILE_PATH', description: 'The path of the .po file to update', type: String, verify_block: proc do |value| UI.user_error!("No .po file path for UpdateMetadataSourceAction given, pass using `po_file_path: 'file path'`") unless value && !value.empty? UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value) end), FastlaneCore::ConfigItem.new(key: :release_version, env_name: 'FL_IOS_UPDATE_METADATA_SOURCE_RELEASE_VERSION', description: 'The release version of the app (to use to mark the release notes)', verify_block: proc do |value| UI.user_error!("No relase version for UpdateMetadataSourceAction given, pass using `release_version: 'version'`") unless value && !value.empty? end), FastlaneCore::ConfigItem.new(key: :source_files, env_name: 'FL_IOS_UPDATE_METADATA_SOURCE_SOURCE_FILES', description: 'The hash with the path to the source files and the key to use to include their content', type: Hash, verify_block: proc do |value| UI.user_error!("No source file hash for UpdateMetadataSourceAction given, pass using `source_files: 'source file hash'`") unless value && !value.empty? end), ] end |
.description ⇒ Object
28 29 30 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata_source.rb', line 28 def self.description 'Updates the AppStoreStrings.po file with the data from text source files' end |
.details ⇒ Object
32 33 34 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata_source.rb', line 32 def self.details 'Updates the AppStoreStrings.po file with the data from text source files' end |
.is_supported?(platform) ⇒ Boolean
75 76 77 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata_source.rb', line 75 def self.is_supported?(platform) %i[ios mac].include?(platform) end |
.output ⇒ Object
65 66 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata_source.rb', line 65 def self.output end |
.return_value ⇒ Object
68 69 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata_source.rb', line 68 def self.return_value end |
.run(params) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata_source.rb', line 4 def self.run(params) # Check local repo status other_action.ensure_git_status_clean other_action.(po_file_path: params[:po_file_path], source_files: params[:source_files], release_version: params[:release_version]) Action.sh("git add #{params[:po_file_path]}") params[:source_files].each_value do |file| Action.sh("git add #{file}") end repo_status = Actions.sh('git status --porcelain') repo_clean = repo_status.empty? return if repo_clean Action.sh('git commit -m "Update metadata strings"') end |