Generalize the regex determining the Xcode version.

The current regex only matches a single digit for each component of the version (e.g. 9.2). This modifies it to match multiple digits in each component, so that e.g. 10.42 will be matched.
This commit is contained in:
Nikoli Dryden 2018-03-05 19:44:11 -06:00 committed by GitHub
parent 1ca2ee6104
commit 11817fe1f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -131,7 +131,7 @@ module OS
xcodebuild_output = Utils.popen_read(xcodebuild_path, "-version") xcodebuild_output = Utils.popen_read(xcodebuild_path, "-version")
next unless $CHILD_STATUS.success? next unless $CHILD_STATUS.success?
xcode_version = xcodebuild_output[/Xcode (\d(\.\d)*)/, 1] xcode_version = xcodebuild_output[/Xcode (\d+(\.\d+)*)/, 1]
return xcode_version if xcode_version return xcode_version if xcode_version
# Xcode 2.x's xcodebuild has a different version string # Xcode 2.x's xcodebuild has a different version string