var pathValue="";
module.exports = function(grunt) {
grunt.initConfig({
copy: {
main: {
files: [{
cwd: 'srcpath', // set working folder / root to copy
src: '**/*', // copy all files and subfolders
dest: 'pathValue', // destination folder
expand: true
}]
}
}
});
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.registerTask('copy', function(n) {
var target = grunt.option('target');
pathValue = target;
// do something useful with target here
});
};
我正在尝试从命令行将目标路径传递给复制任务。我厌倦了命令
grunt 复制 --target=destpath
它说“没有错误地完成”,但没有在目标目录中创建新文件夹。有人可以告诉我代码中的错误是什么吗?