-
Notifications
You must be signed in to change notification settings - Fork 147
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
Add drush launcher to bin, with drush 8 fallback. #1183
Conversation
I like the approach here! Our current plan was that the global installed Drush8 already does the search for the site-specific Drush and if not it falls back to Drush8. But this solution is definitely more elegant and probably better for the future. I'm not sure though if we can really remove the Also we just updated Drush versions: #1185, so we it's conflicting now, sorry. |
Sounds good. There is one thing to change regarding the PATH, we'd need to move the composer reference to the end of PATH. Currently |
Alternatively we could install drush launcher to |
There are a lot of approaches to making drush 9 (explicitly) and drush launcher available. Some people just do |
Mhh are you sure? My understanding is that executables in the home directly should have preference over the global operating system level ones, or you could never overwrite the operation system level ones with local ones (like if you need another
The problem is that we already started supporting
With this:
|
Correct I like the plan you put forward I will follow up. |
I believe this is good to go. In the built image by default...
|
I've not been able to run the tests locally. But I take it I need to make this pass.
But if drush is still drush 8 by default i'm not sure why it would break - unless the Drupal site has drush 9 and this is running in the Drupal site ... so we'd expect the Drush 8 aliases to fail in a best practice situation and we need a Drush 9 alias equivalent in-place - whereever in-place is. I see the tests eg testing the alias is there but I don't see a drush aliases file - would it be using the drush alias service? |
so I think that error might has to do with an old drush version shipped inside the test drupal, I've updated all dependencies of that drupal, let's see |
Checklist
Drush recommends being installed as part of a site, so that a site's composer.json can specify which version of Drush is compatible. Drush launcher is the correct solution: a unified command that dynamically finds and calls Drush. It allows a fallback to the existing global drush.
This PR removes the ~/.composer/... directory from the PATH. It appears that it was only added there to allow
drush
to be executed and is redundant now.The current docs only have a reference to Drush 9, no reference to Drush 8. Not sure exactly what the docs should have, so I just added a note about drush 8 in the drush9.md.
Changelog Entry
Drush launcher is now available. If you have drush available in a Drupal site, and you run
drush
from/app
or the web root, Drush Launcher tries to run the local drush (usuallyvendor/bin/drush
), before falling back to the global Drush. If you need to pin your Drush to the global drush, you should add/home/.composer/vendor/bin/drush
to the start ofPATH
environment variable, or call this directly in your scripts.Closes #1069