Created
February 7, 2013 03:22
-
-
Save johnpbloch/4728137 to your computer and use it in GitHub Desktop.
Automatically commit changes to .md files in a directory on save using grunt watch.
This file contains hidden or 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
| /*global module:false*/ | |
| module.exports = function(grunt) { | |
| // Project configuration. | |
| grunt.initConfig({ | |
| exec: { | |
| commit: { | |
| command: function(grunt){ | |
| var d = new Date(), | |
| datetime = d.toString(); | |
| return "git add *.md; git commit -m 'Document saved (" + datetime + ")'"; | |
| } | |
| } | |
| }, | |
| watch: { | |
| files: '*.md', | |
| tasks: 'exec' | |
| }, | |
| }); | |
| grunt.loadNpmTasks('grunt-exec'); | |
| // Default task. | |
| grunt.registerTask('default', 'exec'); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment