If you want the current shell directory (eg: "sites/mysite.com") to define which site will be used by Drush (eg: "mysite.com"), you can use a shell script with this code:

#!/bin/bash

DRUSH='[here the path to Drush]/drush.php'

OPTIONS='-v'

SITE=`expr $PWD : '.*\/sites\/\(.*\)$'`

if [[ $SITE && "$SITE" != "all" && "$SITE" != "default" ]]
then
    URI="-l http://$SITE"
fi

php $DRUSH $OPTIONS $URI $@

It would be convenient to have this as default.

Vianney Stroebel
Likwid - Spécialistes Drupal - Paris

Comments

moshe weitzman’s picture

Status: Active » Closed (duplicate)

#239524: Make uri argument optional. Please continue the conversation there. This would indeed be a nice feature.