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

Sync always cases error #22

Closed cabralRodrigo closed 10 years ago

cabralRodrigo commented 10 years ago

I'm trying to sync two folders. Here is my task:

sync: {
        main: {
            files: [
                { src: ["www\\**\\*.*", "!**\\*.ts", "!**\\js\\**",], dest: "cordova\\" }
            ],
            verbose: true,
            prentend: false,
            updateAndDelete: true
        }
    }

and here the console output:

Running "sync:main" (sync) task
Removing dir cordova\www\assets\css because not longer in src.
Removing dir cordova\www\assets\img because not longer in src.
Removing dir cordova\www\assets because not longer in src.
Removing dir cordova\www\views because not longer in src.
Removing dir cordova\www because not longer in src.
Fatal error: ENOTEMPTY, rmdir 'C:\Users\Rodrigo\Desktop\app\cordova\www\
assets\css'

Here the sorce folder:

C:\USERS\RODRIGO\DESKTOP\APP\WWW
│   app.ts
│   index.html
│
├───assets
│   ├───css
│   │   ionic.css
│   │
│   ├───img
│   │   logo.png
│   │
│   └───js
│   ionic.bundle.js
│
├───js
│   ├───controllers
│   │   IndexController.ts
│   │
│   ├───models
│   │   produto.ts
│   │
│   └───services
└───views
    dashboard.html

As you can see, even if I've files on the assets/css directory, the grunt-sync try to remove the folder in the destination folder.

Obs.: The files the two folder are properly sync, the only issue is the error message

Anybody can help me?

tomusdrw commented 10 years ago

I have some time reserved on Saturday evening. I will look into this issue. For now if you don't need removal option please run grunt-sync with updateAndDelete: false

cabralRodrigo commented 10 years ago

Thanks for the quick response :+1: I'll go do this while this issue still open.

tomusdrw commented 10 years ago

Let me know if it works with 0.2.2