Skip to content

Commit

Permalink
Merge pull request #220 from phase2/feature/flexible-githook-executor
Browse files Browse the repository at this point in the history
Add config option to specific command runner in git hook scripts.
  • Loading branch information
arithmetric committed Dec 10, 2015
2 parents a33cc6e + b23fff1 commit 8a57176
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 5 additions & 2 deletions CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions tasks/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(' ')
}
Expand Down

0 comments on commit 8a57176

Please sign in to comment.