Skip to content

Instantly share code, notes, and snippets.

@stefgosselin
Created June 11, 2013 04:20
Show Gist options
  • Save stefgosselin/5754465 to your computer and use it in GitHub Desktop.
Save stefgosselin/5754465 to your computer and use it in GitHub Desktop.
Installation - Drush
Installation drush
cd /usr/local/lib/
wget http://ftp.drupal.org/files/projects/drush-7.x-5.9.tar.gz
tar zxvf drush-7.x-5.9.tar.gz
cd drush/ <-----There is drush, just checking
cd /usr/local/bin
ln -s /usr/local/lib/drush/drush drush
Then:
Go to the root folder of your website
cd /root/folder/of/drupalsite
drush
6. Optional. See examples/example.bashrc for instructions on how to add some
useful shell aliases that provides even tighter integration between
drush and bash. You may source this file directly into your shell by adding to
your .bashrc (rr equivalent): source /path/to/drush/examples/example.bashrc
7. Optional. If you didn't source it in Step 6 above, see top of
drush.complete.sh file for instructions adding bash completion for drush
command to your shell. Once configured, completion works for site aliases,
command names, shell aliases, global options, and command-specific options.
8. Optional. If drush.complete.sh is being sourced (ideally in
bash_completion.d), you can use the supplied __drush_ps1() sh function to
add your current drush site (set with `drush use @sitename`) to your PS1
prompt like so:
if [ "\$(type -t __git_ps1)" ] && [ "\$(type -t __drush_ps1)" ]; then
PS1='\u@\h \w$(__git_ps1 " (%s)")$(__drush_ps1 "[%s]")\$ '
fi
Putting this in a .bashrc/.bash_profile/.profile would produce this prompt:
msonnabaum@hostname ~/repos/drush (master)[@sitename]$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment