18.11.2015 Views

Beginning Drupal 8

Todd Tomlinson - Beginning Drupal 8 (The Expert's Voice in Drupal) - 2015

Todd Tomlinson - Beginning Drupal 8 (The Expert's Voice in Drupal) - 2015

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 15 ■ Using Drush<br />

4. Configure your system to recognize where Drush resides. There are three<br />

options:<br />

a. Create a symbolic link to the Drush executable in a directory that is already<br />

in your PATH; for example:<br />

$ ln -s /path/to/drush/drush /usr/bin/drush<br />

b. Explicitly add the Drush executable to the PATH variable, which is defined<br />

in the shell configuration file, called .profile, .bash_profile, .bash_<br />

aliases, or .bashrc, that is located in your home folder; for example:<br />

export PATH="$PATH:/path/to/drush:/usr/local/bin"<br />

Your system will search path options from left to right until it finds a result.<br />

c. Add an alias for Drush; this method can also be handy if you want to use two<br />

versions of Drush, such as Drush 5 or 6 (stable) for <strong>Drupal</strong> 7 development<br />

and Drush 7 (master) for <strong>Drupal</strong> 8 development. To add an alias to your<br />

Drush 7 executable, add this to your shell configuration file (see list in<br />

previous option):<br />

$ alias drush-master=/path/to/drush/drush<br />

For options b and c, to apply your changes to your current session, either log out<br />

and then log back in again, or reload your bash configuration file as follows:<br />

$ source .bashrc<br />

■■Note<br />

If you do not follow this step, you will need to (inconveniently) run Drush commands either by using<br />

the full path to the executable, /path/to/drush/drush, or by navigating to /path/to/drush and running Drush<br />

./drush. The -r or -l option will be required (see USAGE, below).<br />

5. Test that Drush is found by your system:<br />

$ which drush<br />

6. From Drush root, run Composer to fetch dependencies:<br />

$ composer install<br />

For more information about Composer, please visit https://getcomposer.org/doc/00-intro.md.<br />

Installing Drush on Windows<br />

To install Drush on Windows visit https://www.drupal.org/node/594744 for the latest instructions on how<br />

to install Drush on Windows. The approach varies for version of Drush and version of Windows.<br />

170

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!