简体   繁体   English

如何使用Drush命令创建脚本?

[英]How to create script with Drush commands?

Is it possible to create file with sequence of drush commands to be executed? 是否可以使用要执行的drush命令序列来创建文件? In particular, I would like to write script, that would download and enable more Drupal modules for example script with these lines (pseudocode). 特别是,我想编写脚本,该脚本将下载并启用更多Drupal模块,例如带有这些行的脚本(伪代码)。

$modules = {"pathauto", "admin_menu", "i18n"}
drush dl $modules;
drush en $modules;

Is it possible without creating custom drush command? 是否可以不创建自定义drush命令?

I have already found solution. 我已经找到解决方案。 I can create a script with Drush API and using drush_invoke command I can call another drush commands. 我可以使用Drush API创建脚本,并使用drush_invoke命令调用另一个drush命令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM