From dd5b11418a69cc414a3b3dbad19e5b5ccb3b10d3 Mon Sep 17 00:00:00 2001 From: Nemanja Filipovic <55655119+Kukurijek@users.noreply.github.com> Date: Sun, 4 Jul 2021 20:36:52 +0200 Subject: [PATCH] fix selected_version (#4) --- lib/fastlane/plugin/docc/actions/docc_action.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/fastlane/plugin/docc/actions/docc_action.rb b/lib/fastlane/plugin/docc/actions/docc_action.rb index f8bf6f4..c2513dd 100644 --- a/lib/fastlane/plugin/docc/actions/docc_action.rb +++ b/lib/fastlane/plugin/docc/actions/docc_action.rb @@ -12,8 +12,12 @@ def self.run(params) shell_command = command.join(' ') UI.message(shell_command.to_s) + selected_version = sh("xcodebuild -version").match(/^Xcode (.*)$/) + pure_version = selected_version.to_s.sub('Xcode ', '') - (UI.user_error!("Make sure Xcode 13 is installed and select it for Command Line Tool - your version: #{selected_version}") unless selected_version.to_i >= 13.0) unless sh("xcodebuild -version").match(/^Xcode (.*)$/).nil? + unless selected_version.nil? == true + UI.user_error!("Make sure Xcode 13 is installed and select it for Command Line Tool - your version: #{selected_version}") unless pure_version.to_i >= 13.0 + end sh(shell_command.to_s) end