A command line tool to manage local drush installations, similar to rbenv or phpenv.
Build with https://github.com/mislav/everyenv
This will get you going with the latest version of drushenv and make it easy to fork and contribute any changes back upstream.
-
Check out drushenv into
~/.drushenv
.$ git clone https://github.com/webflo/drushenv.git ~/.drushenv
-
Add
~/.drushenv/bin
to your$PATH
for access to thedrushenv
command-line utility.$ echo 'export PATH="$HOME/.drushenv/bin:$PATH"' >> ~/.bash_profile
Ubuntu Desktop note: Modify your
~/.bashrc
instead of~/.bash_profile
.Zsh note: Modify your
~/.zshrc
file instead of~/.bash_profile
. -
Add
drushenv init
to your shell to enable shims and autocompletion.$ echo 'eval "$(drushenv init -)"' >> ~/.bash_profile
Same as in previous step, use
~/.bashrc
on Ubuntu, or~/.zshrc
for Zsh. -
Restart your shell so that PATH changes take effect. (Opening a new terminal tab will usually do it.) Now check if drushenv was set up:
$ type drushenv #=> "drushenv is a function"
Drushenv ships with a handy command to install various drush version with composer.
tl;dr
# Installs the latest stable version of Drush 7.
drushenv install 7 '~7.0'
# Installs the latest dev version of Drush 8.
drushenv install 8 '~8.0@dev'
The first argument is local drush version alias in ~/.drushenv/versions
, the second argument is a composer version constaint for drush/drush
.
Build with https://github.com/mislav/everyenv