Method: FastlaneCore::IpaFileAnalyser.fetch_info_plist_with_unzip

Defined in:
fastlane_core/lib/fastlane_core/ipa_file_analyser.rb

.fetch_info_plist_with_unzip(path) ⇒ Object



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'fastlane_core/lib/fastlane_core/ipa_file_analyser.rb', line 75

def self.fetch_info_plist_with_unzip(path)
  entry, error, = Open3.capture3("unzip", "-Z", "-1", path, "*Payload/*.app/Info.plist")

  # unzip can return multiple Info.plist files if is an embedded app bundle (a WatchKit app)
  #   - ContainsWatchApp/Payload/Sample.app/Watch/Sample WatchKit App.app/Info.plist
  #   - ContainsWatchApp/Payload/Sample.app/Info.plist
  #
  # we can determine the main Info.plist by the shortest path
  entry = entry.lines.map(&:chomp).min_by(&:size)

  UI.command_output(error) unless error.empty?
  return nil if entry.nil? || entry.empty?
  data, error, = Open3.capture3("unzip", "-p", path, entry)
  UI.command_output(error) unless error.empty?
  return nil if data.empty?
  data
end