-
Notifications
You must be signed in to change notification settings - Fork 22
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
Prevent double download (to contrib folder) if module exists in main folder #239
Comments
Interesting. I wonder how common the case is that people start downloading modules and then switch to doing contrib/custom without moving all the contrib ones into contrib. |
I'm not sure, either. Possibly not that common, as drush (still) does the same. But if it were easy to catch... |
Yes, it probably is relatively simple to catch. Needs a bit of thought to ensure the messages are accurate and make sense. |
@indigoxela |
I can't think of a use-case for that. If something went into core, the desired functionality is available already. Downloading the obsolete module causes confusion and IMO provides no benefit. But that's just my 2c. |
Hi @indigoxela - Sorry I've been quiet on this for so long. I've prepared a pull request. I've also improved the messaging around downloading dependencies |
@yorkshire-pudding many thanks for your work, will try to test ASAP. 👍 |
That doesn't seem right... There are use-cases for having the same module in both the root modules directory and the site-specific modules directory. For example, a module is installed in root, but then for a particular site you need a downgraded or patched version. So I'd prefer if that were reverted and this issue just focused on the root vs. root contrib issue. |
@BWPanda - I think the use case you describe is an edge case, but a valid one nonetheless. However the use case you give couldn't currently be done with |
I've done this by just downloading normally, then manually applying a patch from a PR, for example. So it is possible and I don't want to see any regressions in that regard. |
I don't think that making a niche use case use an option to enable this so that for the majority of use cases it is simple and reduces duplication is a regression. In most cases, we focus on making it easier for the majority whilst making advanced and (some) niche uses possible, so I think this approach is in line with that. |
@indigoxela and @BWPanda - new PR which adds an option to download an additional multisite copy of a project. |
@yorkshire-pudding oops, I promised to test, but forgot to do it (shame on me). Many thanks for your work and patience. 🙏 |
No problems. As Peter requested the ability to override for a multisite copy, I needed to do some extra work anyway. |
@indigoxela - a gentle reminder |
|
I'm happy to rename with the same function. I can't think of any genuine use cases for this outside of multisite and it would require more rework than a simple rename. |
Yes, this time I do! 😏 This is how I tested after applying the patch in my bee install:
Switched to a multi-site install.
Then the new param test.
Probably I didn't test every case, but the problem I reported initially is gone. 🎉 |
Thanks @indigoxela - much appreciated |
Also, there is a precedent in other commands to use descriptive options that are longer than one word:
|
This is something Bee shares with Drush.
When downloading a module, the existence of that module in the modules folder is checked, but if a contrib subdirectory exists, and the module exists in the main /modules directory, the module is downloaded again.
To reproduce:
contrib
subdirectory in/modules
/modules
/modules
, one in/modules/contrib
The download is already prevented if no contrib subdir exists, or if the module already is in the contrib folder.
The text was updated successfully, but these errors were encountered: