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
43
44
45
|
# File 'lib/fastlane/plugin/apprepo/actions/run.rb', line 6
def self.run(_params)
program :version, Apprepo::VERSION
program :description, Apprepo::DESCRIPTION
program :help, 'Author', 'Matej Sychra <[email protected]>'
program :help, 'Website', 'https://github.com/suculent/apprepo'
program :help, 'GitHub', 'https://github.com/suculent/apprepo/tree/master/apprepo'
program :help_formatter, :compact
generator = FastlaneCore::CommanderGenerator.new
generator.generate(Apprepo::Options.available_options)
global_option('--verbose') { $verbose = true }
always_trace!
puts _params
command :run do |c|
c.syntax = 'apprepo'
c.description = 'Upload IPA and metadata to SFTP (e.g. Apprepo)'
c.action do |_args, options|
config = FastlaneCore::Configuration
available_opts = Apprepo::Options.available_options
options = config.create(available_opts, options.__hash__)
loaded = options.load_configuration_file('Repofile')
loaded = true if options[:repo_description] || options[:ipa]
unless loaded
UI.message('[Apprepo::CommandsGenerator] configuration file not loaded')
if UI.confirm('No Repofile found. Do you want to setup apprepo?')
require 'apprepo/setup'
Apprepo::Setup.new.run(options)
return 0
end
end
Apprepo::Runner.new(options).run
end
end
end
|