lib/deliver/upload_screenshots.rb in deliver-1.1.1 vs lib/deliver/upload_screenshots.rb in deliver-1.1.2

- old
+ new

@@ -44,19 +44,23 @@ Helper.log.info "Successfully uploaded screenshots to iTunes Connect".green end def collect_screenshots(options) screenshots = [] + extensions = '{png,jpg,jpeg}' Dir.glob(File.join(options[:screenshots_path], "*"), File::FNM_CASEFOLD).sort.each do |lng_folder| language = File.basename(lng_folder) - files = Dir.glob(File.join(lng_folder, '*.{png,PNG,jpg,JPG}')) + files = Dir.glob(File.join(lng_folder, "*.#{extensions}")) next if files.count == 0 - prefer_framed = Dir.glob(File.join(lng_folder, '*_framed.{png,PNG,jpg,JPG}')).count > 0 + prefer_framed = Dir.glob(File.join(lng_folder, '*_framed.#{extensions}')).count > 0 files.each do |path| - next if prefer_framed && !path.include?("_framed.{png,PNG,jpg,JPG}") + if prefer_framed && !path.downcase.include?("_framed.#{extensions}") && !path.downcase.include?("watch") + next + end + screenshots << AppScreenshot.new(path, language) end end return screenshots