Created
October 6, 2014 04:41
-
-
Save esperia/698c089861ab9d246940 to your computer and use it in GitHub Desktop.
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
'use strict'; | |
var exec = require('child_process').exec; | |
module.exports = function(grunt) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
watch: { | |
scripts: { | |
files: [ | |
'Gruntfile.js', | |
'**/*.rst', | |
'_static/*', | |
], | |
tasks: [ | |
'sphinx_build', | |
], | |
options: { | |
interrupt: true, | |
}, | |
}, | |
}, | |
}); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
grunt.registerTask('sphinx_build', '', function(arg) { | |
var done = this.async(); | |
var child = exec('make html', function (error, stdout, stderr) { | |
console.log('stdout: ' + stdout); | |
console.log('stderr: ' + stderr); | |
if (error !== null) { | |
console.log('exec error: ' + error); | |
done(false); | |
} else { | |
done(true); | |
} | |
}); | |
}); | |
//grunt.loadNpmTasks('grunt-sphinx'); | |
// By default, lint and run all tests. | |
grunt.registerTask('default', ['sphinx_build']); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sphinxのドキュメント書いている時、ファイル保存時に毎回
make html
をかけるやつ。