Skip to content

Add pre-execution and post-execution "hooks" #542

@jakub-g

Description

@jakub-g

Hello,

I have an idea of adding some way to define hooks that will be executed before Grunt starts and after it finishes.

Now I can achieve this by creating a task, say gruntBeforeStart and gruntAfterEnd and then use grunt.registerTask('fooHooked', 'gruntBeforeStart foo gruntAfterEnd') but you can see it's not very handy and doesn't scale.

I can think of adding a "magic" tasks -- empty by default -- which will be always executed, regardless of the way Grunt is invoked. The main rationale is to invoke Grunt with any set of tasks I like from the command line, and have the hooks take place as well -- without the need to list them explicitly.

Usage example: timer to execute the whole build time, number of files processed, whatever.

Looking forward to your comments.

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