javascript - Getting Grunt.js to run node.js module -
i have written node.js module can run either file using 'require' or running node copyright.update() terminal. i'm happy functionality , works in both cases. want able run gruntfile.js.
currently grunt file looks this:
module.exports = function(grunt) { grunt.initconfig({ "update-copyright": { "run": true } }); grunt.task.loadtasks('./runner'); };
and script in runner directory looks this:
var copyright = require('./update-copyright'); module.exports = function(grunt) { grunt.registermultitask('update-copyright', 'update copyright headers', function() { var done = this.async(); copyright.update(done); }); };
when run 'grunt update-copright' usual done, without errors nothing has been executed. i'm sure i'm missing simple. appreciated!
thanks comment igor raush got run with:
var copyright = require('./update-copyright'); module.exports = function(grunt) { grunt.registermultitask('update-copyright', 'update copyright headers', function() { var done = this.async(); copyright.update(done); }); };
Comments
Post a Comment