File tree Expand file tree Collapse file tree 1 file changed +5
-14
lines changed
lib/fastlane/plugin/wpmreleasetoolkit/helper/ios Expand file tree Collapse file tree 1 file changed +5
-14
lines changed Original file line number Diff line number Diff line change
1
+ require 'xcodeproj'
2
+
1
3
module Fastlane
2
4
module Helper
3
5
module Ios
@@ -299,21 +301,10 @@ def self.read_build_number_from_config_file(file_path)
299
301
# @return [String] The value for the given key, or `nil` if the key was not found.
300
302
#
301
303
def self . read_from_config_file ( key , file_path )
302
- UI . user_error! ( "File #{ file_path } not found" ) unless File . exist? ( file_path )
303
-
304
- File . open ( file_path , 'r' ) do |f |
305
- f . each_line do |line |
306
- line . strip!
307
- next if line . nil? || line . empty?
308
-
309
- key_value = line . split ( /\s *=\s */ )
310
- if key_value [ 0 ] . strip ( ) == key
311
- return key_value [ 1 ] . strip ( )
312
- end
313
- end
314
- end
304
+ UI . user_error! ( ".xcconfig file #{ file_path } not found" ) unless File . exist? ( file_path )
315
305
316
- return nil
306
+ config = Xcodeproj ::Config . new ( file_path )
307
+ config . attributes [ key ]
317
308
end
318
309
319
310
# Ensure that the version provided is only composed of number parts and return the validated string
You can’t perform that action at this time.
0 commit comments