deliver/lib/deliver/commands_generator.rb in fastlane-2.152.0 vs deliver/lib/deliver/commands_generator.rb in fastlane-2.153.0
- old
+ new
@@ -38,10 +38,11 @@
res ||= ENV["DELIVER_FORCE_OVERWRITE"] # for backward compatibility
res ||= UI.confirm("Do you want to overwrite existing metadata on path '#{File.expand_path(path)}'?") if UI.interactive?
res
end
+ # rubocop:disable Metrics/PerceivedComplexity
def run
program :name, 'deliver'
program :version, Fastlane::VERSION
program :description, Deliver::DESCRIPTION
program :help, 'Author', 'Felix Krause <deliver@krausefx.com>'
@@ -164,18 +165,20 @@
path = options[:metadata_path] || File.join(containing, 'metadata')
res = Deliver::CommandsGenerator.force_overwrite_metadata?(options, path)
return 0 unless res
require 'deliver/setup'
- v = options[:app].latest_version
+ app = options[:app]
+ platform = Spaceship::ConnectAPI::Platform.map(options[:platform])
+ v = app.get_latest_app_store_version(platform: platform)
if options[:app_version].to_s.length > 0
- v = options[:app].live_version if v.version != options[:app_version]
- if v.version != options[:app_version]
+ v = app.get_live_app_store_version(platform: platform) if v.version_string != options[:app_version]
+ if v.nil? || v.version_string != options[:app_version]
raise "Neither the current nor live version match specified app_version \"#{options[:app_version]}\""
end
end
- Deliver::Setup.new.generate_metadata_files(v, path)
+ Deliver::Setup.new.generate_metadata_files(app, v, path)
end
end
default_command(:run)