File tree Expand file tree Collapse file tree
lib/fastlane/plugin/wpmreleasetoolkit/helper/ios Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ require 'xcodeproj'
2+
13module Fastlane
24 module Helper
35 module Ios
@@ -300,21 +302,10 @@ def self.read_build_number_from_config_file(filePath)
300302 # @return [String] The value for the given key, or `nil` if the key was not found.
301303 #
302304 def self . read_from_config_file ( key , file_path )
303- UI . user_error! ( "File #{ file_path } not found" ) unless File . exist? ( file_path )
304-
305- File . open ( file_path , 'r' ) do |f |
306- f . each_line do |line |
307- line . strip!
308- next if line . nil? || line . empty?
309-
310- key_value = line . split ( /\s *=\s */ )
311- if key_value [ 0 ] . strip ( ) == key
312- return key_value [ 1 ] . strip ( )
313- end
314- end
315- end
305+ UI . user_error! ( ".xcconfig file #{ file_path } not found" ) unless File . exist? ( file_path )
316306
317- return nil
307+ config = Xcodeproj ::Config . new ( file_path )
308+ config . attributes [ key ]
318309 end
319310
320311 # 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