Class: BranchIOCLI::Command::ValidateCommand
- Defined in:
- lib/branch_io_cli/command/validate_command.rb
Instance Attribute Summary
Attributes inherited from Command
Instance Method Summary collapse
Methods inherited from Command
available_options, command_name, configuration_class, examples, #helper, #initialize, #patch_helper, return_value, #tool_helper
Constructor Details
This class inherits a constructor from BranchIOCLI::Command::Command
Instance Method Details
#run! ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/branch_io_cli/command/validate_command.rb', line 4 def run! valid = true configurations = config.configurations || config.xcodeproj.build_configurations.map(&:name) configurations.each do |configuration| = "Validating #{configuration} configuration" say "\n<%= color('#{message}', [BOLD, CYAN]) %>\n\n" config_valid = true unless config.domains.blank? domains_valid = helper.validate_project_domains(config.domains, configuration) if domains_valid say "Project domains match :domains parameter: ✅" else say "Project domains do not match specified :domains" helper.errors.each { |error| say " #{error}" } end config_valid &&= domains_valid end entitlements_valid = helper.validate_team_and_bundle_ids_from_aasa_files [], false, configuration unless entitlements_valid say "Universal Link configuration failed validation for #{configuration} configuration." helper.errors.each { |error| say " #{error}" } end config_valid &&= entitlements_valid say "Universal Link configuration passed validation for #{configuration} configuration. ✅" if config_valid valid &&= config_valid end valid ? 0 : 1 end |