Skip to content

Pass callback to grunt.task.run #1184

@donaldpipowitch

Description

@donaldpipowitch

grunt.task.run runs a task after another has finished. However I need to run a task from within a task and process things after the other task has finished. An API like this would be beautiful:

var done = this.async();
grunt.task.run('some-task', function() {
  // do things after 'some-task' finished
  done();
});

I couldn't find a way to do that with the current API.

EDIT:
What I currently do to solve this problem. I use another internal task which runs before/after my some-task. This internal task is only needed to set some dynamic config and shouldn't be called manually. Usage looks like this:

grunt.task.run('internal-task', 'some-task');
// or
grunt.task.run('some-task', 'internal-task');

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions