Skip to content

Commit

Permalink
feat(Runner): allow reusing defined tasks in other tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
RWOverdijk committed Oct 12, 2017
1 parent 05cd1d9 commit 08328c6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/Runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ class Runner {
}

runTask(instruction, parameters) {
if (typeof instruction.definedTask !== 'undefined') {
if (typeof instruction.definedTask !== 'string') {
throw new Error(`definedTask must be a string. Got ${typeof instruction.definedTask}.`);
}

return this.run(instruction.definedTask, Homefront.merge({}, parameters));
}

if (typeof instruction.task === 'function') {
return instruction.task(parameters, boards);
}
Expand Down

0 comments on commit 08328c6

Please sign in to comment.