I have written a node.js module that can be run either from file using 'require' or by running node copyright.update() from the terminal. I'm happy with this functionality and it works in both cases. I want to also be able to run it from Gruntfile.js.
Currently my grunt file looks like this:
module.exports = function(grunt) {
grunt.initConfig({
"update-copyright": {
"run": true
}
});
grunt.task.loadTasks('./runner');
};
And the script in the runner directory looks like 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 I run 'grunt update-copright' I get the usual Done, without errors but nothing has actually been executed. I'm sure I'm missing something simple. Any help is greatly appreciated!
答案 0 :(得分:0)