Drush 8. Have the custom module with the custom command.

Call drush custom-command works as expected.

Call drush --root=sites/subsite custom-command thiggers the error:

The drush command 'custom-command' could not be found.

How to call the drush command in the context of the subsite?

  • Is the custom module enabled in the sub site? – Clive Aug 5 '19 at 8:53
  • Drush 8 on a Drupal 8? Better provide Drush 9 commands from inside your module's src/Commands directory. – leymannx Aug 5 '19 at 10:34
  • Drush 9 handle that pretty good, but there's no possibility to run the @sites alias. – voleger Aug 5 '19 at 13:39

To call a command on a certain instance of a multisite you are supposed to pass the -l option. Also be sure that the custom module that provides the custom command is enabled on the multisite instance you are trying to call that command on.

$ drush custom-command -l subsite

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.