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
73 74 75 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata_source.rb', line 73 def self. ['Automattic'] end |
.available_options ⇒ Object
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 64 65 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata_source.rb', line 38 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
30 31 32 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata_source.rb', line 30 def self.description 'Updates the AppStoreStrings.po file with the data from text source files' end |
.details ⇒ Object
34 35 36 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata_source.rb', line 34 def self.details 'Updates the AppStoreStrings.po file with the data from text source files' end |
.is_supported?(platform) ⇒ Boolean
77 78 79 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata_source.rb', line 77 def self.is_supported?(platform) %i[ios mac].include?(platform) end |
.output ⇒ Object
67 68 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata_source.rb', line 67 def self.output end |
.return_value ⇒ Object
70 71 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata_source.rb', line 70 def self.return_value end |
.run(params) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata_source.rb', line 6 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 |