Created
May 8, 2010 00:15
-
-
Save stemount/394177 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Download Drush v3 from D.O and make it work on `drush` (OS X / Linux / *nix) | |
# Written by stemount, adapted by KarenS | |
# Last updated by Drupalise IT (http://drupalise.it) on 13 Sep 2010 | |
# Update user | |
echo "Drush is now downloading via HTTP" | |
# move to home dir | |
cd ~ | |
# remove current drush (if existent) | |
rm -rf ~/.drush/ | |
# create drush directory (and hide it) | |
mkdir ~/.drush/ | |
# move to new dir | |
cd ~/.drush/ | |
# get Drush v3 | |
curl -C - -O -s http://ftp.drupal.org/files/projects/drush-All-versions-3.0.tar.gz | |
# extract Drush v3 | |
tar -xf drush*.tar.gz | |
# bin Drush tar | |
rm -f drush-All*.tar.gz | |
# get Pear Console Table library | |
# This is to be depreciated in favour of a more reliable way | |
# pear install console_table | |
cd drush/includes | |
curl -C - -O -s http://download.pear.php.net/package/Console_Table-1.1.3.tgz | |
# extract Pear | |
tar -xf Console_Table*.tgz | |
# copy the file we need | |
cp Console_Table-1.1.3/Table.php table.inc | |
# bin Console_Table tar | |
rm -r Console_Table-1.1.3 | |
rm -f Console_Table*.tgz | |
# make drush command executable | |
cd ~/.drush/ | |
chmod u+x drush/drush | |
# alias drush and put in bash profile | |
echo "alias drush='~/.drush/drush/drush'" >> ~/.bash_profile | |
# 'source' the .bash_profile file so updates are made | |
source ~/.bash_profile | |
# make sure that we alias drush just in case source does not work | |
alias drush='~/.drush/drush/drush' | |
# Update user on install | |
echo "You should see three SUCCESS(s) below if properly installed" | |
# Update Drush using Drush | |
~/.drush/drush/drush dl drush | |
# update drush_make and provision in drush/commands | |
~/.drush/drush/drush dl drush_make | |
~/.drush/drush/drush dl provision | |
# move updated additions to correct directory | |
mv ~/.drush/provision ~/.drush/drush/commands/ | |
mv ~/.drush/drush_make ~/.drush/drush/commands/ | |
# everything is installed, tell the user | |
echo "Drush should now be installed. type 'drush' for commands." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## How to install | |
Copy & Paste the following into a command line / CLI as your user (not root, wheel, sudo) | |
It is to be run from one line. The script will delete itself upon use. | |
curl -s -o installer.sh http://gist.github.com/raw/394177/c1cab6e589207c902a72f5c73122b6dfe065128c/Drush%20Download%20Script && chmod +x installer.sh && ./installer.sh && rm -f ./installer.sh | |
### To cleanup previous installs of Drush (not required, ignore if not previously installed) | |
rm -rf ~/.drush/ | |
remove the line with alias drush='~/.drush/drush/drush' from your ~/.bash_profile |
There is now a Pear installer for drush that is the preferred way to install drush; please see the drush project page for details. In any event, it is not correct to install drush in the ~/.drush folder. ~/.drush is for configuration files and drush extensions. Finally, it is not nice to rm -rf ~/.drush in an install script; the user might have something useful there.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The one line script, with the Git 301 redirect, should now be:
curl -s -o installer.sh https://gist.github.com/raw/394177/c1cab6e589207c902a72f5c73122b6dfe065128c/Drush%20Download%20Script && chmod +x installer.sh && ./installer.sh && rm -f ./installer.sh