To whom may concern,
As the title said, I'm wondering is there anyway to inject/call/execute Magento default commands in my custom command?
I'm just another guy who living in Terminal world and I'm exhausted while have to press ↑ then Enter for those commands all day.
At this moment, I'm forced to write a bash script to shorten it. So I think it is better if I wrote a custom command of Magento 2 to do those jobs. Then I can just simple use bash alias that command in my way.
For example:
I need to execute setup:upgrade
, rm -rf var/generation var/di
, setup:di:compile
in just only one command and few more thing (actually a lot) after setup:di:compile
executed successfully.
setup:upgrade
is handled by this class \Magento\Setup\Console\Command\UpgradeCommand
setup:di:compile
is handle by this one \Magento\Setup\Console\Command\DiCompileCommand
But I'm not sure is it Ok to call execute()
method in my custom command?
Anyone have any ideas for this situation?