Skip to content

Instantly share code, notes, and snippets.

@zviryatko
Last active December 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zviryatko/bd1e25a8d2af2da9639d to your computer and use it in GitHub Desktop.
Save zviryatko/bd1e25a8d2af2da9639d to your computer and use it in GitHub Desktop.
Allow drush to run above the drupal root directory
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