deliver/lib/deliver/setup.rb in fastlane_hotfix-2.165.1 vs deliver/lib/deliver/setup.rb in fastlane_hotfix-2.187.0
- old
+ new
@@ -1,6 +1,5 @@
-require 'open-uri'
require 'spaceship/tunes/tunes'
require_relative 'module'
require_relative 'download_screenshots'
require_relative 'upload_metadata'
@@ -38,17 +37,17 @@
end
# This method takes care of creating a new 'deliver' folder, containing the app metadata
# and screenshots folders
def generate_deliver_file(deliver_path, options)
- app = options[:app]
+ app = Deliver.cache[:app]
platform = Spaceship::ConnectAPI::Platform.map(options[:platform])
v = app.get_latest_app_store_version(platform: platform)
metadata_path = options[:metadata_path] || File.join(deliver_path, 'metadata')
- generate_metadata_files(app, v, metadata_path)
+ generate_metadata_files(app, v, metadata_path, options)
# Generate the final Deliverfile here
return File.read(deliverfile_path)
end
@@ -58,12 +57,17 @@
else
return "#{Deliver::ROOT}/lib/assets/DeliverfileDefault"
end
end
- def generate_metadata_files(app, version, path)
+ def generate_metadata_files(app, version, path, options)
# App info localizations
- app_info = app.fetch_live_app_info || app.fetch_edit_app_info
+ if options[:use_live_version]
+ app_info = app.fetch_live_app_info
+ UI.user_error!("The option `use_live_version` was set to `true`, however no live app was found on App Store Connect.") unless app_info
+ else
+ app_info = app.fetch_edit_app_info || app.fetch_live_app_info
+ end
app_info_localizations = app_info.get_app_info_localizations
app_info_localizations.each do |localization|
language = localization.locale
UploadMetadata::LOCALISED_APP_VALUES.each do |file_key, attribute_name|