fastlane/lib/fastlane/actions/get_version_number.rb in fastlane-2.74.1 vs fastlane/lib/fastlane/actions/get_version_number.rb in fastlane-2.75.0.beta.20180109010003

- old
+ new

@@ -37,20 +37,20 @@ '"SampleProject.xcodeproj/../SampleProject/supporting_files/TargetC_internal-Info.plist"=7.5.2', '"SampleProject.xcodeproj/../SampleProject/supporting_files/TargetC_production-Info.plist"=6.4.9', '"SampleProject.xcodeproj/../SampleProject_tests/Info.plist"=1.0' ] else - results = (Actions.sh command).split("\n") + results = Actions.sh(command).split("\n") end if target.empty? && scheme.empty? # Sometimes the results array contains nonsense as the first element # This iteration finds the first 'real' result and returns that # emulating the actual behavior or the -terse1 flag correctly project_string = ".xcodeproj" results.any? do |result| - if result.include? project_string + if result.include?(project_string) line = result break end end else @@ -59,19 +59,19 @@ scheme_string = "/#{scheme}" target_string = "/#{target}/" plist_target_string = "/#{target}-" results.any? do |result| if !target.empty? - if result.include? target_string + if result.include?(target_string) line = result break - elsif result.include? plist_target_string + elsif result.include?(plist_target_string) line = result break end else - if result.include? scheme_string + if result.include?(scheme_string) line = result break end end end @@ -110,11 +110,11 @@ FastlaneCore::ConfigItem.new(key: :xcodeproj, env_name: "FL_VERSION_NUMBER_PROJECT", description: "optional, you must specify the path to your main Xcode project if it is not in the project root directory", optional: true, verify_block: proc do |value| - UI.user_error!("Please pass the path to the project, not the workspace") if value.end_with? ".xcworkspace" + UI.user_error!("Please pass the path to the project, not the workspace") if value.end_with?(".xcworkspace") UI.user_error!("Could not find Xcode project at path '#{File.expand_path(value)}'") if !File.exist?(value) and !Helper.is_test? end), FastlaneCore::ConfigItem.new(key: :scheme, env_name: "FL_VERSION_NUMBER_SCHEME", description: "Specify a specific scheme if you have multiple per project, optional. " \ @@ -139,10 +139,10 @@ def self.authors ["Liquidsoul"] end def self.is_supported?(platform) - [:ios, :mac].include? platform + [:ios, :mac].include?(platform) end def self.example_code [ 'version = get_version_number(xcodeproj: "Project.xcodeproj")'