I have the following code for grunt file:
var fs = require('fs');
module.exports = function (grunt) {
'use strict';
grunt.initConfig({
running: {
taskOwner: 'ali',
src: 'js/somefile.js',
dest: 'somefile.js'
},
multi: {
config1: {
message: 'this is config1'
},
config2: {
message: 'this is config2'
}
}
});
grunt.registerTask('running', 'An example task', function () {
var done = this.async();
grunt.config.requires('running.taskOwner');
grunt.log.writeln(grunt.config.get('running.src'));
grunt.log.writeln(grunt.config.get('running.dest'));
fs.readFile(grunt.config.get('running.src'),function(error,data){
fs.writeFile(grunt.config.get('running.dest'),data)
done();
});
});
grunt.registerMultiTask('multi', 'An example multi task', function () {
grunt.log.writeln(this.data.message);
});
grunt.registerTask('run', 'run all tasks', ['running']);
};
I got this message and do not know why
[DEP0013] DeprecationWarning: Calling an asynchronous function without callback is deprecated.
any one can help ?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…