Skip to content

Call after (or done) callback after task ends #770

Open
@schovi

Description

@schovi

I have developement task like
grunt.registerTask("dev", ["server", "jshint", "copy:dev", "coffeelint", "coffee", "watch"])
which will start server and copy files from /src into /public where is index.html and server pointed.

This will copy (or compile) lot of files into public directory.
After my work session I want to cleanup this directory. I looked for something like after, done or teardone callback which will run some task after the main task is killed, or finished.

var task = grunt.registerTask("dev", ["server", "jshint", "copy:dev", "coffeelint", "coffee", "watch"])

// With Deferred API this will be called when main task is break, killed, finished or end from any other reason
task.always(function() {
  grunt.task.requires('cleanup');
})

I tried to check sources, but did not find anything like this. Is there any way, how to do that, or is it planning feature?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions