Skip to content

Delete files in outide folder. Force with you #5

@kartofelek007

Description

@kartofelek007

Now we can't sync files outside workind directory. Add options and force:

grunt.registerMultiTask('delete_sync', 'Synchronize file deletion between two directories.', function() {
        var options = this.options();
        this.files.map(function(file) {
            file.src.map(function (val) {
                var targetFileName = file.cwd + '/' + val;
                if(grunt.file.isFile(targetFileName) && !grunt.file.exists(file.syncWith + '/' + val)) {
                    grunt.log.writeln('Deleting file ' + targetFileName);
                    grunt.file.delete(targetFileName, options);
                }
            });
        });

    });
loremIpsum: {
      options : {
             force : true
      },
      cwd: '../../../web/loremIpsum',
      src: ['**/*'],
      syncWith: 'dist/loremIpsum'
},

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions