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

Fix regexp in get_dmg method #402

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

makesource
Copy link

@makesource makesource commented Sep 14, 2020

Thank you for great library 😀
I found two issues in get_dmg regexp.

Issue

1. This does not matches upper case name.

Default downloaded xcode file name was Xcode_${version}.xip,
but this expression does not match this so the cache doesn't work properly.
Currently the cache seems to work because of right below issue, but not really

(maybe related to this PR #388..
But it has not been merged yet, so I included this change as well.)

2. without parentheses, the expression matches any xip extensions.

/^xcode_#{version}\.dmg|xip$/ -> /^xcode_#{version}\.dmg$/ or /^xip$/ -> ❌ (Any xip extension will matches this)
/^xcode_#{version}\.(dmg|xip)$/ -> /^xcode_#{version}\.dmg$/ or /^xcode_#{version}\.xip$/ -> ⭕ What we are expected!

lib/xcode/install.rb Outdated Show resolved Hide resolved
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.

2 participants