Skip to content

Instantly share code, notes, and snippets.

@making
Last active October 6, 2015 01:35
Show Gist options
  • Save making/7d176e7e5995faaf23dc to your computer and use it in GitHub Desktop.
Save making/7d176e7e5995faaf23dc to your computer and use it in GitHub Desktop.
Sphinx watch build
$ npm install
$ gulp watch
var gulp = require('gulp');
var exec = require('child_process').exec;
gulp.task('build', function () {
exec('make html', {cwd: '.'}, function (error, stdout, stderr) {
if (error) console.error('[error]: ' + error);
if (stdout) console.log('[stdout]: ' + stdout);
if (stderr) console.warn('[stderr]: ' + stderr);
});
});
gulp.task('watch', function () {
gulp.watch('./**/*.rst', ['build']);
});
{
"name": "doc",
"version": "1.0.0",
"description": "",
"main": "gulpfile.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "@making",
"license": "ISC",
"devDependencies": {
"gulp": "^3.9.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment