grunt
grunt copied to clipboard
Call after (or done) callback after task ends
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?
:+1:
+1
I wanna use grunt-notify whenever a task finishes ; something like this would be very useful.
:+1:
+1
+1
+1
:+1:
:+1:
:+1: #542 mentioned plans to bring an event-based hook mechanism in https://github.com/tkellen/node-task Unfortunately this subproject has been stopped.
+100
+101
I added a gist which I use to hook around the grunt.task.run here: https://gist.github.com/mdasberg/92455614afbe6987cc8f
That would be great +1
+100
+1000
+1