Task to synchronize two directories. Similar to grunt-copy but updates only files that have been changed. Additional option to override read only files based on .
Task to synchronize two directories. Similar to grunt-copy but updates only files that have been changed. Additional option to modify file permissions, a la
This plugin requires Grunt
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-smart_copy --save-dev
In your project's Gruntfile, add a section named
smart_copy to the data object passed into
gruntinitConfigsmart_copymain:files:cwd: 'src'src:'**' /* Include everything */'!**/*.txt' /* but exclude txt files */dest: 'bin'writeCode: 666 // Overrite code;
Default value: none (required)
A string value to specify the permissions' numeric mode to set on the files and/or directories, e.g.:
smart_copy:main:files:src: 'path/**' // includes files in path and its subdirsdest: 'dest/'cwd: 'path/' // makes all src relative to cwdsrc: '**/*.js' '**/*.css'dest: 'dest/'
smart_copy:main:files:cwd: 'c:/source'src: '**' '!Bin/**' 'config ' '! * .log 'dest: 'd:/dest'writeCode: 666 // Overrite code
'666'(read/write for all users) or
'444'(read only for all users). Whatever number is set in the user column (the hundreds place value) will become the value for all columns (user, group, and other), e.g.
'444'. The default permissons for both newly created files and folders is