Skip to content

Instantly share code, notes, and snippets.

@anavdesign
Last active January 29, 2019 03:39
Show Gist options
  • Save anavdesign/d5e7998b20e63f38733e418d4c7fcc50 to your computer and use it in GitHub Desktop.
Save anavdesign/d5e7998b20e63f38733e418d4c7fcc50 to your computer and use it in GitHub Desktop.
Drupal: Drush Command Line Shell

Drush

A command line shell for Drupal.

Resources

Installation

  1. Install a global version of Drush using Composer

    composer global require drush/drush:dev-master
    
  2. Shared Hosting

    To make it easier to use, add an alias to your .bash_profile or .bashrc file:

    alias drush='~/.composer/vendor/bin/drush'
    

Drush Launcher

Drush Launcher is basically a small wrapper that is triggered when you run drush. It looks if you're inside a Drupal project directory, then finds if there's a local version of Drush installed with the project. If so, it uses that version of Drush, configured for each Drupal project you work on.

For convenience, instead of passing the --fallback option any time you're using Drush outside a Composer-based Drupal project directory, you can set the environment variable DRUSH_LAUNCHER_FALLBACK, for example in your .bash_profile:

export DRUSH_LAUNCHER_FALLBACK=~/.composer/vendor/bin/drush

Drush Commands

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment