-1
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 copy --target=destpath

「エラーなしで完了」と表示されますが、宛先ディレクトリに新しいフォルダーが作成されません。誰かがコードのエラーを教えてもらえますか?

4

1 に答える 1