Run Drush commands on DDEV without ”exec”

2020. Mar. 22. · 1 min read

I use drush a lot when I work with Drupal. Hosting Drupal on DDEV locally I should prefix my commands, so they look like ddev exec drush …. One can find it in the documentation of DDEV.

It is not mentioned on that documentation page, but there is a small trick which let us skip exec. So we can save four characters every time we type a drush command! 😎

To make it possible find the .ddev/commands/web/drush.example file and rename or duplicate it as .ddev/commands/web/drush. And that’s all! From now you can write ddev drush …!

Of course, it is not my “magic” but a solution from the developers of DDEV. It is documented too – just on an other page. The note is about custom commands which provides other nice possibilities as well so it worth reading! 🙂