From 46be166a04fb5f83a431c9f675951b0598de7615 Mon Sep 17 00:00:00 2001 From: Vlad Date: Sat, 12 Dec 2020 21:12:05 +0300 Subject: [PATCH] Code correction --- xcode/commonFastfile | 6 +++--- xcode/fastlane/touchlane/lib/touchlane/features.rb | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/xcode/commonFastfile b/xcode/commonFastfile index 3446ca5..48b8c8a 100644 --- a/xcode/commonFastfile +++ b/xcode/commonFastfile @@ -106,14 +106,14 @@ private_lane :addShield do |options| end end -private_lane lane :uploadFeaturesToProject do |options| +private_lane :uploadFeaturesToProject do |options| app_target_folder_name = options[:appName] || $appName project_features_file_path = File.expand_path "../#{app_target_folder_name}/Resources/Features.json" common_features_file_path = File.expand_path "../common/build_options/Features.yaml" - builder_features_list = options[:features] # [ "Feature1", "Feature2", "Feature3" ] - + builder_features_list = options[:features].split(",").map { |feature_name| feature_name.strip } # [ "Feature1", "Feature2", "Feature3" ] + Touchlane::Features.generate_features_file_in_project(builder_features_list, common_features_file_path, project_features_file_path) end diff --git a/xcode/fastlane/touchlane/lib/touchlane/features.rb b/xcode/fastlane/touchlane/lib/touchlane/features.rb index 3345c01..4806fba 100644 --- a/xcode/fastlane/touchlane/lib/touchlane/features.rb +++ b/xcode/fastlane/touchlane/lib/touchlane/features.rb @@ -16,7 +16,7 @@ module Touchlane # Generate JSON from feature names feature_bodies = builder_features_list.map { |feature_name| { :name => feature_name, :enabled => true} } - features = { :features => features_body } + features = { :features => feature_bodies } features_json = JSON.pretty_generate(features) unless File.exists? project_features_file_path @@ -32,7 +32,7 @@ module Touchlane unless File.exists? path raise "Unable to load features from file at #{path}" else - YAML.load_file(path)["features"] + YAML.load_file(path) end end