File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -105,13 +105,28 @@ protected function fire()
105105 */
106106 protected function getTasks ($ container )
107107 {
108- $ tasks = [$ task = $ this ->argument ('task ' )];
108+ return $ this ->buildTaskList ($ container , $ this ->argument ('task ' ));
109+ }
109110
111+ /**
112+ * Build a list of tasks starting from a task or macro name.
113+ *
114+ * @param array $tasks
115+ * @param \Laravel\Envoy\TaskContainer $container
116+ * @param string $task
117+ * @return array
118+ */
119+ protected function buildTaskList ($ container , $ task , $ tasks = []): array
120+ {
110121 if ($ macro = $ container ->getMacro ($ task )) {
111- $ tasks = $ macro ;
122+ foreach ($ macro as $ task ) {
123+ $ tasks = $ this ->buildTaskList ($ container , $ task , $ tasks );
124+ }
125+
126+ return $ tasks ;
112127 }
113128
114- return $ tasks ;
129+ return [... $ tasks, $ task ] ;
115130 }
116131
117132 /**
You can’t perform that action at this time.
0 commit comments