Skip to content

Commit c501b1d

Browse files
committed
Added loadAction method
1 parent d07a947 commit c501b1d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Console.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ public function loadPipeline(string $filename): PipelineConsoleRuntime
3434
return $factory(new PipelineConsoleRuntime($this->output, $pipeline, $this->state->withPipeline(basename($filename))));
3535
}
3636

37+
public function loadAction(string $filename): PipelineConsoleRuntime
38+
{
39+
$factory = require $filename;
40+
41+
$pipeline = new Pipeline($this->pipelineRunner);
42+
43+
return $factory(new PipelineConsoleRuntime($this->output, $pipeline, $this->state->withPipeline(basename($filename))));
44+
}
45+
3746
public function job(RunnableInterface $job): self
3847
{
3948
$this->jobs[] = $job;

0 commit comments

Comments
 (0)