class Fastlane::Helper::PlistPatcher

Public Class Methods

patch(archive, plist_path, values, commands) click to toggle source
# File lib/fastlane/plugin/facelift/helper/plist_patcher.rb, line 4
def self.patch(archive, plist_path, values, commands)
  archive.extract(plist_path)

  UI.message("Patching Plist: #{plist_path}")

  plist_buddy = PlistBuddy.new archive.local_path(plist_path)

  values.each do |key, value|
    plist_buddy.exec "Set #{key} #{value}"
  end if values

  commands.each do |command|
    plist_buddy.exec command
  end if commands

  archive.replace(plist_path)
end