Last active
December 29, 2015 14:21
-
-
Save zviryatko/bd1e25a8d2af2da9639d to your computer and use it in GitHub Desktop.
Allow drush to run above the drupal root directory
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
function drush { | |
DRUSH=$(which drush) | |
PWD=$(pwd) | |
if [ -f 'drush/drushrc.php' ]; | |
then | |
$DRUSH -c ./drush/drushrc.php "$@"; | |
elif [ -d "$PWD/web" ]; | |
then | |
$DRUSH --root="$PWD/web" "$@"; | |
else | |
$DRUSH "$@"; | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment