Class: Deliver::CommandsGenerator
- Inherits:
-
Object
- Object
- Deliver::CommandsGenerator
- Includes:
- Commander::Methods
- Defined in:
- lib/deliver/commands_generator.rb
Constant Summary collapse
- UI =
FastlaneCore::UI
Class Method Summary collapse
Instance Method Summary collapse
-
#run ⇒ Object
rubocop:disable Metrics/AbcSize rubocop:disable Metrics/MethodLength.
Class Method Details
Instance Method Details
#run ⇒ Object
rubocop:disable Metrics/AbcSize rubocop:disable Metrics/MethodLength
20 21 22 23 24 25 26 27 28 29 30 31 32 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 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/deliver/commands_generator.rb', line 20 def run program :version, Deliver::VERSION program :description, Deliver::DESCRIPTION program :help, 'Author', 'Felix Krause <[email protected]>' program :help, 'Website', 'https://fastlane.tools' program :help, 'GitHub', 'https://github.com/fastlane/deliver' program :help_formatter, :compact FastlaneCore::CommanderGenerator.new.generate(Deliver::Options.) global_option('--verbose') { $verbose = true } always_trace! command :run do |c| c.syntax = 'deliver' c.description = 'Upload metadata and binary to iTunes Connect' c.action do |args, | = FastlaneCore::Configuration.create(Deliver::Options., .__hash__) loaded = .load_configuration_file("Deliverfile") loaded = true if [:description] || [:ipa] || [:pkg] # do we have *anything* here? unless loaded if agree("No deliver configuration found in the current directory. Do you want to setup deliver? (y/n)".yellow, true) require 'deliver/setup' Deliver::Runner.new() # to login... Deliver::Setup.new.run() return 0 end end Deliver::Runner.new().run end end command :init do |c| c.syntax = 'deliver init' c.description = 'Create the initial `deliver` configuration based on an existing app' c.action do |args, | if File.exist?("Deliverfile") or File.exist?("fastlane/Deliverfile") Helper.log.info "You already got a running deliver setup in this directory".yellow return 0 end require 'deliver/setup' = FastlaneCore::Configuration.create(Deliver::Options., .__hash__) Deliver::Runner.new() # to login... Deliver::Setup.new.run() end end command :generate_summary do |c| c.syntax = 'deliver generate_summary' c.description = 'Generate HTML Summary without uploading/downloading anything' c.action do |args, | = FastlaneCore::Configuration.create(Deliver::Options., .__hash__) .load_configuration_file("Deliverfile") Deliver::Runner.new() html_path = Deliver::GenerateSummary.new.run() UI.success "Successfully generated HTML report at '#{html_path}'" system("open '#{html_path}'") unless [:force] end end command :download_screenshots do |c| c.syntax = 'deliver download_screenshots' c.description = "Downloads all existing screenshots from iTunes Connect and stores them in the screenshots folder" c.action do |args, | = FastlaneCore::Configuration.create(Deliver::Options., .__hash__) .load_configuration_file("Deliverfile") Deliver::Runner.new() # to login... path = (FastlaneCore::Helper.fastlane_enabled? ? './fastlane' : '.') Deliver::DownloadScreenshots.run(, path) end end command :download_metadata do |c| c.syntax = 'deliver download_metadata' c.description = "Downloads existing metadata and stores it locally. This overwrites the local files." c.action do |args, | = FastlaneCore::Configuration.create(Deliver::Options., .__hash__) .load_configuration_file("Deliverfile") Deliver::Runner.new() # to login... path = (FastlaneCore::Helper.fastlane_enabled? ? './fastlane' : '.') res = ENV["DELIVER_FORCE_OVERWRITE"] res ||= agree("Do you want to overwrite existing metadata on path '#{File.(path)}/metadata'? (y/n)", true) if res require 'deliver/setup' v = [:app].latest_version Deliver::Setup.new.(v, path) else return 0 end end end # rubocop:enable Metrics/AbcSize # rubocop:enable Metrics/MethodLength default_command :run run! end |