4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'fastlane/lib/fastlane/actions/update_urban_airship_configuration.rb', line 4
def self.run(params)
require "plist"
begin
path = File.expand_path(params[:plist_path])
plist = Plist.parse_xml(path)
plist['developmentAppKey'] = params[:development_app_key] unless params[:development_app_key].nil?
plist['developmentAppSecret'] = params[:development_app_secret] unless params[:development_app_secret].nil?
plist['productionAppKey'] = params[:production_app_key] unless params[:production_app_key].nil?
plist['productionAppSecret'] = params[:production_app_secret] unless params[:production_app_secret].nil?
plist['detectProvisioningMode'] = params[:detect_provisioning_mode] unless params[:detect_provisioning_mode].nil?
new_plist = plist.to_plist
File.write(path, new_plist)
rescue => ex
UI.error(ex)
UI.error("Unable to update Urban Airship configuration for plist file at '#{path}'")
end
end
|