Wednesday, 14 November 2012

Installing drush

So we've all established that Drush is the bee's knees for running drupal installations. Right?

So tonight I had to install it on a server where I have limited rights.

This was the process (based on perusing the README.txt):

# install drush
mkdir -p $ptd
tar -xf ~/drush-$dv.tar.gz -C $ptd
chmod u+x $ptd/drush/drush
ln -sf $ptd/drush/drush ~/bin/drush
ln -sf $ptd/drush/examples/example.bashrc ~/bin/drush.bashrc
# put drush.bashrc into .bashrc
if grep -Fq "drush.bashrc" .bashrc
 echo "you already have drush.bashrc in your .bashrc, so no action taken"
 echo "drush.bashrc added to you .bashrc"
 echo "source ~/bin/drush.bashrc" >> .bashrc
# tidy up

The bit I like best is greping the .bashrc so I only add the require line once.

I also had to track down php-cli that drush was complaining about. So I just used locate then made a link:
locate php-cli
ln -sf /hsphere/shared/php53/bin/php-cli bin/php-cli

No comments:

Post a Comment