Skip to content

Hook into right before and right after grunt tasks are run

License

Notifications You must be signed in to change notification settings

TheSavior/grunt-before-after-hooks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grunt-before-after-hooks Build Status

Add hooks to run before every Grunt task and after they are all complete

Install

$ npm install --save grunt-before-after-hooks

Usage

module.exports = grunt => {
  // require it at the top and pass in the grunt instance
  require('grunt-before-after-hooks')(grunt, {
    beforeEach(currentTask) {
      console.log(JSON.stringify(currentTask));
      /*
      {"nameArgs":"plugin_tester","name":"plugin_tester","args":[],"flags":{},"errorCount":0}
      */
    },
    afterEach(previousTask) {
      console.log(JSON.stringify(currentTask));
      /*
      {"nameArgs":"plugin_tester","name":"plugin_tester","args":[],"flags":{},"errorCount":0}
      */
    },
    after() {

    }
  });

  grunt.initConfig();
}

The argument given to the beforeEach and afterEach hooks are instances of grunt.task.current.

About

Hook into right before and right after grunt tasks are run

Resources

License

Stars

Watchers

Forks

Packages