tasks/qiniu_deploy.js
function makeUploadTask(cwd, file) {
            var key = options.keyGen(cwd, file);
            function doUpload(callback) {
                var absolutePath = path.join(cwd, file);
                grunt.log.ok('Start uploading the file [' + file + '], qiniu key is: [' + key + ']');
                client.uploadFile(absolutePath, {key: key}, function(err, result) {
                    if (!err) {
                        grunt.log.ok('The file [' + file + '] has been uploaded yet.');
                    }
                    callback(err, result);
                });
            }

            return function(callback) {
                if (options.ignoreDup) {
                    // 验证是否已经存在此文件，存在则不重复上传
                    client.stat(key, function(err, stat) {
                        if (err || stat.error) {
                            doUpload(callback);

                        } else {
                            grunt.log.ok('The key [' + key + '] exists, so ignore it');
                            callback(null);
                        }
                    })

                } else {
                    doUpload(callback)
                }
            }
        }
function makeUploadTask(cwd, file) {
            var key = options.keyGen(cwd, file);
            function doUpload(callback) {
                var absolutePath = path.join(cwd, file);
                grunt.log.ok('Start uploading the file [' + file + '], qiniu key is: [' + key + ']');
                client.uploadFile(absolutePath, {key: key}, function(err, result) {
                    if (!err) {
                        grunt.log.ok('The file [' + file + '] has been uploaded yet.');
                    }
                    callback(err, result);
                });
            }

            return function(callback) {
                if (options.ignoreDup) {
                    // 验证是否已经存在此文件，存在则不重复上传
                    client.stat(key, function(err, stat) {
                        if (err || stat.error) {
                            doUpload(callback);

                        } else {
                            grunt.log.ok('The key [' + key + '] exists, so ignore it');
                            callback(null);
                        }
                    })

                } else {
                    doUpload(callback)
                }
            }
        }
构造async接收的task
@param cwd
@param file