Class: Fastlane::Helper::PlistPatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/fastlane/plugin/facelift/helper/plist_patcher.rb

Class Method Summary collapse

Class Method Details

.patch(archive, plist_path, values, commands) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 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