Class: Fastlane::Actions::ConfigureAddFilesToCopyAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::ConfigureAddFilesToCopyAction
- Defined in:
- lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_add_files_to_copy_action.rb
Class Method Summary collapse
- .absolute_secret_store_path(relative_path) ⇒ Object
-
.add_file ⇒ Object
Walks the user through adding a file to the project’s ‘/.configure `file.
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .return_value ⇒ Object
- .run(params = {}) ⇒ Object
- .secret_store_dir ⇒ Object
Class Method Details
.absolute_secret_store_path(relative_path) ⇒ Object
65 66 67 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_add_files_to_copy_action.rb', line 65 def self.absolute_secret_store_path(relative_path) Fastlane::Helper::FilesystemHelper.absolute_secret_store_path(relative_path) end |
.add_file ⇒ Object
Walks the user through adding a file to the project’s ‘/.configure `file.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_add_files_to_copy_action.rb', line 33 def self.add_file invalid_file = true while invalid_file UI.header 'Please provide the location of the source file relative to the secrets repository' UI. 'Example: google-services.json' source = UI.input('Source File Path:') source_path = absolute_secret_store_path(source) # Transform the relative path into an absolute path. # Don't allow the developer to accidentally specify an invalid file, otherwise validation will never succeed. if File.file?(source_path) invalid_file = false else UI.error "There is no file at #{source_path}." end end UI.header 'Please provide the destination of the file relative to the project root' UI. 'Example: WordPress/google-services.json' destination = UI.input('Destination File Path:') # Leave the destination as a relative path, as no validation is required. encrypt = UI.confirm('Encrypt file?:') Fastlane::Helper::ConfigureHelper.add_file(source: source, destination: destination, encrypt: encrypt) end |
.authors ⇒ Object
73 74 75 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_add_files_to_copy_action.rb', line 73 def self. ['Automattic'] end |
.available_options ⇒ Object
85 86 87 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_add_files_to_copy_action.rb', line 85 def self. [] end |
.description ⇒ Object
69 70 71 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_add_files_to_copy_action.rb', line 69 def self.description 'Interactively add files to the `files_to_copy` list in .configure.' end |
.details ⇒ Object
81 82 83 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_add_files_to_copy_action.rb', line 81 def self.details 'Interactively add files to the `files_to_copy` list in .configure.' end |
.is_supported?(platform) ⇒ Boolean
89 90 91 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_add_files_to_copy_action.rb', line 89 def self.is_supported?(platform) true end |
.return_value ⇒ Object
77 78 79 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_add_files_to_copy_action.rb', line 77 def self.return_value # If your method provides a return value, you can describe here what it does end |
.run(params = {}) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_add_files_to_copy_action.rb', line 12 def self.run(params = {}) continue = true while continue confirmation = 'Do you want to specify a file that should be copied from the secrets repository into your project?' confirmation = 'Do you want to specify additional files that should be copied from the secrets repository into your project?' if Fastlane::Helper::ConfigureHelper.has_files if UI.confirm(confirmation) add_file else continue = false end Fastlane::Helper::ConfigureHelper.files_to_copy.each(&:update) end end |
.secret_store_dir ⇒ Object
61 62 63 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_add_files_to_copy_action.rb', line 61 def self.secret_store_dir Fastlane::Helper::FilesystemHelper.secret_store_dir end |