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

brew install: search casks if not found #3985

Merged
merged 1 commit into from Mar 25, 2018

Conversation

Projects
None yet
2 participants
@HaraldNordgren
Copy link
Contributor

HaraldNordgren commented Mar 25, 2018

Fixes #3829

I looked at the difference between Library/Homebrew/cmd/search.rb and install.rb to figure out why they don't work in the same way. Turns out we pass the regex instead of the name which then won't work in the install scenario. That is not how it is used internally in search.

Tested this locally with anaconda and it works. Also refactored the code a bit to unify the usage of the regex variable between the search.rb and install.rb files

@HaraldNordgren HaraldNordgren force-pushed the HaraldNordgren:brew_install__search_casks_if_not_found branch from ab50272 to 5db2ed4 Mar 25, 2018

@@ -277,7 +277,7 @@ def install
# Do not search taps if the formula name is qualified
return if e.name.include?("/")
ohai "Searching taps..."
taps_search_results = search_taps(query)
taps_search_results = search_taps(e.name)

This comment has been minimized.

@HaraldNordgren

HaraldNordgren Mar 25, 2018

Contributor

Compare to

local_results = search_formulae(regex)

tap_results = search_taps(query)
where query is the input before creating the regex.

The equivalent thing here is to pass e.name.

@MikeMcQuaid

This comment has been minimized.

Copy link
Member

MikeMcQuaid commented Mar 25, 2018

Nice work! Thanks so much for your first contribution! Without people like you submitting PRs we couldn't run this project. You rock, @HaraldNordgren!

@MikeMcQuaid MikeMcQuaid merged commit 6a56181 into Homebrew:master Mar 25, 2018

3 checks passed

codecov/patch 100% of diff hit (target 70.13%)
Details
codecov/project 70.15% (+0.01%) compared to d9e3ff6
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@HaraldNordgren HaraldNordgren deleted the HaraldNordgren:brew_install__search_casks_if_not_found branch Mar 25, 2018

@Homebrew Homebrew locked and limited conversation to collaborators May 4, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.