-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Labels
Description
I've setup a pre-commit hook using grunt-githooks on a branch of my repository. If I switch to a branch that is not configured with a gruntfile it blocks me from committing with the error "Fatal error: Unable to find Gruntfile."
It seems like it could be a good practice change the hook script from binding into specific grunt tasks to instead:
- First checking for the existence of the Gruntfile
- If no Gruntfile exists exit the hook without blocking.
- Then checking the Gruntfile to see if githooks is configured
- If githooks is not configured in the gruntfile then exit the hook without blocking.
- Then checking and running the tasks assigned to the current hook in the Gruntfile.
This will allow for changing the tasks to be run per hook by just modifying the gruntfile, and also allow for different tasks, or no tasks, to be run on different branches.
Reactions are currently unavailable