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 "no matches for wildcard" error in env-setup.fish script. #58345

Merged
merged 2 commits into from
Jun 27, 2019

Conversation

ElijahLynn
Copy link
Contributor

SUMMARY

Fix "no matches for wildcard" error in env-setup.fish script. See fish-shell/fish-shell#5960

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

hacking/env-setup.fish

ADDITIONAL INFORMATION

Before

> ❯ source ./hacking/env-setup.fish
./hacking/env-setup.fish (line 69): No matches for wildcard “$PREFIX_PYTHONPATH/ansible*.egg-info”. See `help expand`.
    if test -e $PREFIX_PYTHONPATH/ansible*.egg-info
               ^
in function “gen_egg_info”
        called on line 88 of file ./hacking/env-setup.fish
from sourcing file ./hacking/env-setup.fish
        called on standard input

After


> ❯ source ./hacking/env-setup.fish                                      
> Appending PYTHONPATH                                                   
> running egg_info 
...

@ansibot ansibot added affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. core_review In order to be merged, this PR must follow the core review workflow. needs_triage Needs a first human triage before being processed. small_patch support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Jun 25, 2019
if test -e $PREFIX_PYTHONPATH/ansible*.egg-info
# Cannot use `test` on wildcards.
# @see https://github.com/fish-shell/fish-shell/issues/5960
if count $PREFIX_PYTHONPATH/ansible*.egg-info > /dev/null
rm -rf "$PREFIX_PYTHONPATH/ansible*.egg-info"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ummm... this bit won't work, because the "*" is quoted?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hrm, I tested it locally and it worked nicely. Are you saying I should quote it?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noooo.

The rm -rf argument should not be quoted, is what I'm saying.

Copy link

@faho faho Jun 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm -rf "$PREFIX_PYTHONPATH/ansible*.egg-info" does not work because of the quotes.

When you say "it worked nicely", what you mean is presumably that you're not seeing the error anymore. But that's probably just because no file matches, so the rm is never executed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see now. I was still looking at the if line, doh. I'll fix and test locally.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! Fixed, tested, pushed!

@jillr jillr removed the needs_triage Needs a first human triage before being processed. label Jun 27, 2019
@samdoran samdoran self-assigned this Jun 27, 2019
@jillr jillr assigned samdoran and unassigned samdoran Jun 27, 2019
@samdoran
Copy link
Contributor

@ElijahLynn @faho Thank you for this fix. I could not figured out a way to get rid of this error when I wrote that line. Much appreciated, and I learned something. 😄

@samdoran samdoran merged commit 19c6448 into ansible:devel Jun 27, 2019
@ansible ansible locked and limited conversation to collaborators Aug 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. core_review In order to be merged, this PR must follow the core review workflow. small_patch support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants