drush-ops / drush-launcher

A small wrapper around Drush for your global $PATH.
GNU General Public License v2.0
237 stars 50 forks source link

Add fallback support. #37

Closed weitzman closed 6 years ago

weitzman commented 6 years ago

User may fallback to a global drush if site local is not found.

mitrpaka commented 6 years ago

Could this fallback support extended also to D7 sites that are not following drupal-composer layout i.e. sites that are built using conventional methods (drush make)?

Existing solution is never triggered for D7 sites that are built using conventional methods as !$drupalFinder->locateRoot($ROOT) check will return TRUE and execution terminated before reaching to fallback support.

https://github.com/mitrpaka/drush-launcher/commit/13afd43a6b748738780bdef68e028d25cb7ed0d1

webflo commented 6 years ago

The code makes sense. I would like to add the changes from @mitrpaka as well. But the flow is complicated. We would end up with the fallback code twice.

I am going to restructure the the existing code. Instead of using a guard clause for the fallback. I will start with the best case (site local drush etc) and call the fallback it that fails.

webflo commented 6 years ago

@weitzman @mitrpaka Please review https://github.com/drush-ops/drush-launcher/pull/39