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

Using --fallback option results in option-does-not-exist #58

Closed attrib closed 5 years ago

attrib commented 6 years ago

If you use --fallback=/opt/drush.8.phar but the launcher finds a drush 9, the drush call fails with The "--fallback" option does not exist.

I'm not sure and didn't tested it as I just use the envoirment variable now, but I think in $_SERVER['argv'] the --fallback=... needs to be removed. The prepareArgument function is only called if the fallback is used.

webflo commented 6 years ago

I think your are right, drush-launcher does not modify the input ($_SERVER['argv']). I think we should keep it like that. Parsing the input with all its quicks is not easy. --fallback should conflict with options from standard drush commands.

I think we should either remove the --fallback option or rename it to something more explicit like --drush-launcher-fallback.

The handling though the environment variable looks much simple and less error prone to me.

ping @weitzman

weitzman commented 6 years ago

Well, global drush9 is not a supported thing. Drush does not document or recommend that. But still, we don't have to make lives harder for folks.

I'm fine with dropping the option and expecting an env variable.

attrib commented 6 years ago

@webflo It is conflicting with drush, as it exit with The "--fallback" option does not exist., expect when I also add --strict=0.

So in my mind its either dropping --fallback at all or add to the readme that if you add --fallback you need to add --strict too.

darrenoh commented 5 years ago

@weitzman, I just ran into this issue. There is no global drush9. The global fallback is drush8, but this error appears if the site has a local drush9.

weitzman commented 5 years ago

Fixed in #73. Use env variable instead of --fallback.