Skip to content

Allow a nested inline subtask in the new syntax #61

@satazor

Description

@satazor

The new syntax does allow inline nested subtasks. While this is not common, it's desirable in some cases. Before we could do something like:

var myTask = {
    name: 'my-task',
    tasks: [
    {
        name: 'inline-task',
        tasks: [
            // ...
        ]
    }
    ]
}

I suggest something like:

module.exports = function (task) {
    task
    .name('my-task')
    .do(function (options, ctx, next) {
        var inlineTask = ctx.task()
        .name('inline-task')
        .do(/** ... */)
        .do(/** ... */;

        next(null, inlineTask);
    });
};

This even allows to create a inline task asynchronously.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions