AndyOGo / node-sync-glob

Synchronize files and folders locally by glob patterns, watch option included.
MIT License
19 stars 1 forks source link

Incorrect copy on watch #17

Closed zont closed 7 years ago

zont commented 7 years ago

Have folders:

src
     - config.json
     - index.html
out

Run:

sync-glob -w src/**/*.{html,json} out

DELETE out
COPY src\config.json to out\config.json
COPY src\index.html to out\index.html
WATCHING src/**/*.{html,json}

Try edit config.json and save:

COPY src\config.json to out\src\config.json

File writed to incorrect path

Should be the same is initial COPY:

COPY src\config.json to out\config.json
AndyOGo commented 7 years ago

@zont Thank you for your report. I will firstly work on #18, then I will make a test case for your issue.

AndyOGo commented 7 years ago

@zont I finished automated testing and fixed some nifty bugs during this too and version 1.1.0 is out.

May I ask you to check if this issue is resolved for you?

Important: please make sure to wrap your globs within ' quotes, cause otherwise your CLI's shell will interpret these globs and expand them, instead of letting node-sync-glob evaluate them itself, like:

sync-glob -w 'src/**/*.{html,json}' out

As mentioned in the readme https://github.com/AndyOGo/node-sync-glob#note

zont commented 7 years ago

Sorry, but now I use https://www.npmjs.com/package/copy-and-watch

AndyOGo commented 7 years ago

@zont alright, thanks for feedback though

david-hollifield commented 7 years ago

FWIW, I'm having this same issue using v1.3.7 of sync-glob

AndyOGo commented 7 years ago

@david-hollifield Thanks for your feedback. May I ask you to provide platform and environment details.

If you are on windows, it has known bugs originating form chokidar. Since NSFW is released I'm considering switching to it, see #39

david-hollifield commented 7 years ago

Yes, I'm on windows 10.