keyboardcowboy/drush-multidrush

Manage multiple versions of Drush.

dev-master 2015-11-11 17:29 UTC

This package is not auto-updated.

Last update: 2024-10-26 18:33:24 UTC


README

Manage multiple versions of Drush on your server.

References

Requirements

Currently you must have composer installed and discoverable in your $PATH as either composer.phar or composer.

You must also have drush already installed. That was the easiest way to get this off the ground.

There is an issue to provide additional download options, but it adds significant complexity and time. I promise I'll work on it, but for now it's probably easier to simply install composer.

There is also an issue to get this running without needing to first install drush.

Why?

Each version of Drupal requires a different version of Drush. If you are running multiple versions of Drupal, you will need multiple versions of Drush.

Who?

The main use case is developers who have already been using Drush to manage D6 or D7 sites and are now getting involved in D8 and must have multiple versions of Drush available depending on the site they are working on.

Or use Vagrant instead. That works too.

Installation

With Composer

  1. Run composer require keyboardcowboy/drush-multidrush inside any directory drush can scan.
  2. Run drush cc drush to clear drush's cache.
  3. Run drush mdi to download Drush 6, 7 and 8 and configure your $PATH

Commands

  • drush multidrush-init (mdi)
    Download Drush 6, 7 and 8 and prepare your $PATH to look for this version of Drush.

  • drush multidrush-switch (mds, switch)
    Switch to a different version of Drush.

How it Works

Through the clever use of symlinking, we can switch which version of Drush is found on the $PATH. Currently we use composer to download three versions of drush and then symlink to whichever you want to use.

Dependencies

Roadmap

The composer dependency is restrictive, I know. I just need a little time (or some help) to implement alternative download methods.

I could also use some help checking this cross-platform. Currently it works great on my Mac. That's all I know.

Troubleshooting

  • Make sure you do not have a version of Drush downloaded into any of the places Drush looks for plugins. If you do and switch to a version that is not the same as the one in this directory, it's basically the same as crossing the streams.

    • /etc/drush
    • ~/.drush
    • /sites/all/drush