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: Skip hidden directories when creating commands #6081
fix: Skip hidden directories when creating commands #6081
Conversation
da3e0d3
to
743b90b
Compare
Download the artifacts for this pull request:
See Testing a PR. |
If this is at all controversial I can live with moving my directory |
So you use directories named I think it's totally reasonable to skip hidden directories, but interested in how you ended up here. |
It's right in the PR description. :p
|
It would be nice to come up with a standardized way for commands to share libraries. We got stuck on this with the launch refactoring. |
I don't think we did get stuck - I mentioned an approach in that PR but the implementors decided to go with a different approach. For custom commands outside the DDEV codebase that obviously won't be as helpful - maybe it's worth opening an issue about that. In any case the scope of this PR is intentionally very narrow to fix what I perceive to be a bug with how hidden directories in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested, it looks good to me 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! There's only one problem that I see... changing the code for exactly one dev's workflow :) But that one person is a valued contributor, so thanks! And thanks for checking the test coverage while you were there.
One developer's workflow today ;p Fixing small issues like this can reduce friction for others to do similar things if they want to. |
The Issue
DDEV thinks hidden directories in
~/.ddev/commands/
hold commands for services with names that start with a.
This can result in commands like this showing up:
Note that the
composer.lock
,composer.json
, andconfig.yml
files all live in a hidden directory.(For reference,
.php-utils/
here contains code and dependencies that my global host commands share - see https://github.com/GuySartorelli/my-ddev-commands if you're curious)How This PR Solves The Issue
Skips hidden directories, so that files in those directories are not treated like commands.
Manual Testing Instructions
Add a hidden directory in
~/.ddev/commands/
with some files in it and runddev
- before the PR they will show up in the commands list, but afterwards they shouldn't.Automated Testing Overview
Tests that a command in a hidden directory doesn't show in the commands list
Related Issue Link(s)
N/A
Release/Deployment Notes
In the very unlikely scenario where someone does actually have a service where the name of the services starts with a
.
, they will no longer be able to add global commands for it. That strikes me as exceedingly unlikely though.