pilot/lib/pilot/build_manager.rb in fastlane-2.90.0 vs pilot/lib/pilot/build_manager.rb in fastlane-2.91.0.beta.20180413050017

- old
+ new

@@ -1,7 +1,8 @@ require 'tmpdir' require 'terminal-table' +require 'emoji_regex' require 'fastlane_core/itunes_transporter' require 'fastlane_core/build_watcher' require 'fastlane_core/ipa_upload_package_builder' require_relative 'manager' @@ -9,11 +10,11 @@ module Pilot class BuildManager < Manager def upload(options) start(options) - options[:changelog] = self.class.truncate_changelog(options[:changelog]) if options[:changelog] + options[:changelog] = self.class.sanitize_changelog(options[:changelog]) if options[:changelog] UI.user_error!("No ipa file given") unless config[:ipa] if options[:changelog].nil? && options[:distribute_external] == true if UI.interactive? @@ -125,10 +126,23 @@ original_length = changelog.length bottom_message = "..." changelog = "#{changelog[0...max_changelog_length - bottom_message.length]}#{bottom_message}" UI.important("Changelog has been truncated since it exceeds Apple's #{max_changelog_length} character limit. It currently contains #{original_length} characters.") end - return changelog + changelog + end + + def self.strip_emoji(changelog) + if changelog && changelog =~ EmojiRegex::Regex + changelog.gsub!(EmojiRegex::Regex, "") + UI.important("Emoji symbols have been removed from the changelog, since they're not allowed by Apple.") + end + changelog + end + + def self.sanitize_changelog(changelog) + changelog = strip_emoji(changelog) + truncate_changelog(changelog) end private def describe_build(build)