small refactor

This commit is contained in:
Ivan Smolin 2019-02-22 14:40:46 +03:00
parent 214ea3e5e2
commit b87aa69a4b
1 changed files with 12 additions and 7 deletions

View File

@ -93,13 +93,8 @@ end
private_lane :syncCodeSigning do |options|
type = options[:type] || "development"
configurations_path = "./fastlane/configurations.yaml"
if File.exists? configurations_path
require "yaml"
configurations = YAML.load_file(configurations_path)
options.merge(configurations[type])
end
options_override = load_options_from("configurations.yaml")[type]
options.merge(options_override)
match(
app_identifier: options[:app_identifier],
@ -131,3 +126,13 @@ private_lane :updateCodeSigning do |options|
options[:readonly] = false
syncCodeSigning(options)
end
def load_options_from(file_path)
if File.exists? file_path
require "yaml"
return YAML.load_file(file_path)
end
return nil
end