diff --git a/lib/motion/project/template/ios/config.rb b/lib/motion/project/template/ios/config.rb index c3f072dc..5827e338 100644 --- a/lib/motion/project/template/ios/config.rb +++ b/lib/motion/project/template/ios/config.rb @@ -90,22 +90,24 @@ module Motion; module Project; if launch_images_asset_bundle path = asset_bundle_partial_info_plist_path(platform) if File.exist?(path) - content = `/usr/libexec/PlistBuddy -c 'Print :UILaunchImages' "#{path}"`.strip - images = [] - current_image = nil - content.split("\n")[1..-2].each do |line| - case line.strip - when 'Dict {' - current_image = {} - when '}' - images << current_image - current_image = nil - when /(\w+) = (.+)/ - current_image[$1] = $2 + content = `/usr/libexec/PlistBuddy -c 'Print :UILaunchImages' "#{path}" 2>&1`.strip + if $?.success? + images = [] + current_image = nil + content.split("\n")[1..-2].each do |line| + case line.strip + when 'Dict {' + current_image = {} + when '}' + images << current_image + current_image = nil + when /(\w+) = (.+)/ + current_image[$1] = $2 + end + end + unless images.empty? + info_plist['UILaunchImages'] = images end - end - unless images.empty? - info_plist['UILaunchImages'] = images end end end diff --git a/lib/motion/project/xcode_config.rb b/lib/motion/project/xcode_config.rb index 637f32c2..7dbc34d9 100644 --- a/lib/motion/project/xcode_config.rb +++ b/lib/motion/project/xcode_config.rb @@ -534,8 +534,10 @@ EOS if app_icons_asset_bundle path = asset_bundle_partial_info_plist_path(platform) if File.exist?(path) - content = `/usr/libexec/PlistBuddy -c 'Print :CFBundleIcons:CFBundlePrimaryIcon:CFBundleIconFiles' "#{path}"`.strip - self.icons = content.split("\n")[1..-2].map(&:strip) + content = `/usr/libexec/PlistBuddy -c 'Print :CFBundleIcons:CFBundlePrimaryIcon:CFBundleIconFiles' "#{path}" 2>&1`.strip + if $?.success? + self.icons = content.split("\n")[1..-2].map(&:strip) + end end end end