Skip to content

Instantly share code, notes, and snippets.

@ludder
Created May 20, 2014 07:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ludder/66324083931d9de77e56 to your computer and use it in GitHub Desktop.
Save ludder/66324083931d9de77e56 to your computer and use it in GitHub Desktop.
Copy git hooks to hooks folder with Grunt
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