lib/deliver/detect_values.rb in deliver-1.15.1 vs lib/deliver/detect_values.rb in deliver-1.16.0
- old
+ new
@@ -2,11 +2,13 @@
class DetectValues
def run!(options, skip_params = {})
find_app_identifier(options)
find_app(options)
find_folders(options)
+ ensure_folders_created(options)
find_version(options) unless skip_params[:skip_version]
+ find_platform(options)
end
def find_app_identifier(options)
return if options[:app_identifier]
@@ -32,14 +34,16 @@
UI.user_error!("Could not find app with app identifier '#{options[:app_identifier]}' in your iTunes Connect account (#{options[:username]} - Team: #{Spaceship::Tunes.client.team_id})")
end
end
def find_folders(options)
- containing = Helper.fastlane_enabled? ? './fastlane' : '.'
+ containing = Helper.fastlane_enabled? ? FastlaneCore::FastlaneFolder.path : '.'
options[:screenshots_path] ||= File.join(containing, 'screenshots')
options[:metadata_path] ||= File.join(containing, 'metadata')
+ end
+ def ensure_folders_created(options)
FileUtils.mkdir_p(options[:screenshots_path])
FileUtils.mkdir_p(options[:metadata_path])
end
def find_version(options)
@@ -50,8 +54,16 @@
elsif options[:pkg]
options[:app_version] ||= FastlaneCore::PkgFileAnalyser.fetch_app_version(options[:pkg])
end
rescue
UI.user_error!("Could not infer your app's version")
+ end
+
+ def find_platform(options)
+ if options[:ipa]
+ options[:platform] ||= FastlaneCore::IpaFileAnalyser.fetch_app_platform(options[:ipa])
+ elsif options[:pkg]
+ options[:platform] = 'osx'
+ end
end
end
end