Created
May 20, 2014 07:45
-
-
Save ludder/66324083931d9de77e56 to your computer and use it in GitHub Desktop.
Copy git hooks to hooks folder with Grunt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grunt.registerTask('default', function () { | |
var fs = require('fs'); | |
// my precommit hook is inside the repo as /hooks/pre-commit | |
// copy the hook file to the correct place in the .git directory | |
grunt.file.copy('hooks/pre-commit', '.git/hooks/pre-commit'); | |
// chmod the file to readable and executable by all | |
fs.chmodSync('.git/hooks/pre-commit', '755'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment