diff --git a/CONFIG.md b/CONFIG.md index ce284a4d..d491b1a7 100644 --- a/CONFIG.md +++ b/CONFIG.md @@ -706,9 +706,12 @@ task. This version, specifically invoked by `validate:staged` attempts to minimize the number of files scanned by checking only those that have changed since the last successful commit. -#### Configuring Additional Tasks +#### Configuring Git Hooks -**config.git.hooks**: An array of grunt tasks to run on pre-commit. +**config.git.hooks**: An array of grunt tasks to run on pre-commit in addition to `validate:staged`. + +**config.git.hook-command**: A substitute for a simple `grunt` command to handle the individual grunt tasks. +Allows specification of more complex bin paths or execution wrappers such as `time` or `docker-compose`. #### Overriding a Commit Rejection diff --git a/tasks/git.js b/tasks/git.js index 79e134f7..fa0a1c03 100644 --- a/tasks/git.js +++ b/tasks/git.js @@ -25,6 +25,9 @@ module.exports = function(grunt) { // Githooks task may be configured via Gruntconfig. grunt.config('githooks', { + options: { + command: grunt.config('config.git.hook-command') || 'grunt' + }, gdt: { 'pre-commit': _.unique(tasks).join(' ') }