Skip to content

Instantly share code, notes, and snippets.

@danieluhl
Last active December 2, 2015 19:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danieluhl/30b88b8a5f1db7a02f9d to your computer and use it in GitHub Desktop.
Save danieluhl/30b88b8a5f1db7a02f9d to your computer and use it in GitHub Desktop.
An example of how to run node commands from grunt and get the output result
'use strict';
module.exports = function(grunt) {
grunt.registerTask('runTests', '', function() {
var done = this.async();
grunt.util.spawn({
cmd: 'node',
args: ['./js/tests/runner/tests.js']
}, function(e, result) {
printResult(e, result);
done();
});
});
function printResult(e, result) {
if (e) {
grunt.log.writeln(e);
} else if (result) {
grunt.log.writeln(result);
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment