Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[version-name] Try stripping .0 patch version to find a matching Xcode #19

Merged
merged 1 commit into from Aug 5, 2020

Conversation

robertbressi
Copy link
Contributor

The purpose of this PR is to add handling to xcenv-version-name to account for versions specified as X.X.0. Even though Xcode's CFBundleShortVersionString tends to drop the trailing patch number in the version specifier, it's conceivable that someone might want to include the patch version in their command for the sake of consistency (i.e.: 11.6.0, 11.6.1 etc).

This functionality has been written such that it doesn't assume that Apple will continue the pattern of dropping the patch version in Xcode's CFBundleShortVersionString, however, this means that in all cases of a failed version match, the find_xcode_app_from_version function will be run twice. Instead, if we accept the aforementioned assumption, we can simply check whether the version passed into the command meets the X.X.0 format and simply drop the patch version immediately. Happy to take feedback on this!

@maschall
Copy link
Contributor

maschall commented Aug 4, 2020

This looks great! Thank you for writing tests! I’m going to test it tomorrow and merge it in.

@maschall maschall merged commit 5ae88b6 into xcenv:master Aug 5, 2020
@maschall
Copy link
Contributor

maschall commented Aug 5, 2020

Thank you again!

@robertbressi
Copy link
Contributor Author

Thank you again!

Thanks, @maschall, for creating and maintaining xcenv! It's an amazing utility that I've been using for a long time, and I'm glad to have been able to make a tiny improvement to it 👍

@robertbressi robertbressi deleted the strip-final-0-from-version branch August 6, 2020 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants