I want to provide a website to monitor my grunt tasks. I run some grunt stuff to run tasks, and I use the grunt-contrib-watch to run these tasks whenever any file is saved.
So, I figured a node server might spawn this grunt watcher, and listen for outputs from the `grunt watch´ process.
Am I thinking anywhere nearby a cool solution here? (I visualize some kind of Jenkins functionality here)
So, my code that I until now came up with is very short:
var spawn = require('child_process').spawn;
var grunt = spawn('grunt watch');
grunt.stderr.on('data', function (data) {
'use strict';
console.log('grunt stderr: ' + data);
});
grunt.on('close', function (code) {
'use strict';
if (code !== 0) {
console.log('grunt process exited with code ' + code);
}
});
grunt.stdout.on('data', function (data) {
'use strict';
console.log('grunt ', data);
});
but it throws the following error, which I can't really interpret, even though trying google my best :(
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:988:11)
at Process.ChildProcess._handle.onexit (child_process.js:779:34)
What do you say? Wouldn't this be really nice? A great thing to be able to put on a tv screen on the office or something...