grunt icon indicating copy to clipboard operation
grunt copied to clipboard

I want to do something before task exit , what should I do?

Open huanghaiyang opened this issue 9 years ago • 1 comments

I create a grunt plugin , when I press ctrl+c, the grunt exit , but I want to do something in the grunt plugin before the process exit.

I tried like this

grunt.registerMultiTask('task1', 'runtask', function () {
    function exitFn(){
        console.log('the task exit.')
    }
    process.on('uncaughtException', exitFn)
    process.on('exit', exitFn)
}

it's not work.

tks!

huanghaiyang avatar Jul 27 '16 05:07 huanghaiyang

#1543 Looks similar to this issue

heyayush avatar Mar 29 '17 14:03 heyayush