Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallel cpx tasks don't work quite right? #127

Open
JaneSmith opened this issue Feb 17, 2018 · 1 comment
Open

Parallel cpx tasks don't work quite right? #127

JaneSmith opened this issue Feb 17, 2018 · 1 comment

Comments

@JaneSmith
Copy link

"watchimg:a": "cpx ./source/assets/images/** ./publish/assets/images -v -w",
"watchimg:b": "cpx ./source/themes/01/assets/images/** ./publish/themes/01/assets/images -v -w",
"watchimg:c": "cpx ./source/themes/02/assets/images/** ./publish/themes/02/assets/images -v -w",
"watchimg": "run-p watchimg:*",

When I execute npm run watchimg:a or npm run watchimg:b or npm run watchimg:c, it works fine. It watches one directory and copies files across.

However, when I execute npm run watchimg, which uses run-p internally, it doesn't seem to work as expected. The console does print out all three scripts, but cpx prints "Be watching in ..." for only two out of three directories. Basically, it only seems to actually be watching two directories, and the third one is just "dead". File changes in that dead directory do not get picked up. Which of the commands are working properly seems to vary randomly when watchimg is run, but it's always two that work as expected, and one that doesn't.

You might say this is a bug in cpx instead of npm-run-all, but again: the individual tasks work fine. It only gets broken when I use watchimg with run-p.

Any ideas?

@JaneSmith
Copy link
Author

Tested this same setup with parallelshell instead of npm-run-all and it works fine. I guess I'll just use that instead for now.

"watchimg:a": "cpx ./source/assets/images/** ./publish/assets/images -v -w",
"watchimg:b": "cpx ./source/themes/01/assets/images/** ./publish/themes/01/assets/images -v -w",
"watchimg:c": "cpx ./source/themes/02/assets/images/** ./publish/themes/02/assets/images -v -w",
"watchimg": "parallelshell \"npm run watchimg:a\" \"npm run watchimg:b\" \"npm run watchimg:c\"",

This prints out "Be watching in ..." for all three directories, and changes to all three directories work properly. npm-run-all just doesn't work right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant