Closed tjconcept closed 8 years ago
Thank you for this issue.
Hmm, cpx
does copy files then start watching files.
For example, on this repo:
C:\Users\t-nagashima.AD\Documents\GitHub\cpx [master]> cpx src/**/*.js aaa --watch --verbose
Copied: src/command.js --> aaa/command.js
Copied: src/copy.js --> aaa/copy.js
Copied: src/cpx.js --> aaa/cpx.js
Copied: src/index.js --> aaa/index.js
Copied: src/queue.js --> aaa/queue.js
Copied: src/utils.js --> aaa/utils.js
Be watching in src
This behavior relies on chokidar
.
chokidar
emits "add"
events while initialization by default: https://github.com/paulmillr/chokidar#path-filtering
Oh, seems like the problem was caused by ./
in front of source and destination paths e.g. ./src/**/*.js
- how can that be? Is it expected?
Ouch, that's a bug!
Maybe I am doing something wrong, but I miss an option for having the program watch a directory and copy everything over initially. Currently I run the command twice; with and without
--watch
.