tomusdrw / grunt-sync

[Not actively developed] Grunt.js task providing one-way synchronization of directories. Instead of copying all files only those that has been changed are copied which actually results in much faster execution.
MIT License
77 stars 19 forks source link

cwd folder in dest? #24

Closed Sysix closed 9 years ago

Sysix commented 9 years ago

Hello Guys,

i have a strange problem. At first my Gruntfile.js:

var imageExtension = '{png,jpg,gif,svg,ico}';
// some code
        sync: {
            default: {
                files: [{
                    expand: true,
                    cwd: "dev/",
                    src: ['**', '!*.{js,scss}', '!*.' + imageExtension],
                    dest: "public/"
                }],
                verbose: true
            }
        },

When i editing a file, he create folders, which in named by the file and cwd-parameter.

Example Logfile:

Running "watch:misc" (watch) task
Waiting...
>> File "dev\index.html" deleted.
>> File "dev\index2.html" renamed.

Running "newer:sync:default" (newer) task

Running "sync:default" (sync) task
Creating public\dev\
Copying dev\index2.html -> public\index2.html\dev\index2.html

My target: Copying dev\index2.html to public\index2.html What i make wrong?

tomusdrw commented 9 years ago

Hi!

Which version of grunt-sync are you using? I've checked your example on most recent on Linux and Windows and it seems to work fine.

Sysix commented 9 years ago

Hello^^ i found my Problem. grunt-newer return a wrong list of files. With sync:default it's works :)