zont / copy-and-watch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Folders don't appear to be mirrored

alexblack opened this issue · comments

I'm running this command:

copy-and-watch src/public/**/*.{html,css,jpg,png} build

with this result:

[COPY] src/public/panel.html to build/panel.html
[COPY] src/public/panel.css to build/panel.css
[COPY] src/public/icons/icon128.png to build/icon128.png
[COPY] src/public/icons/icon16.png to build/icon16.png
[COPY] src/public/icons/icon19.png to build/icon19.png
[COPY] src/public/icons/icon48.png to build/icon48.png

I expected the png files to end up in build/icon not build

Ah, changing it to this solved the issue:

copy-and-watch src/**/*.{html,css} src/**/*.{jpg,png} build --clean

What's the difference between the two ? I'm having a similar issue with hierarchy beeing flatten

The solution is to surround the paths with quotation marks like this:
copy-and-watch "src/public/**/*.{html,css,jpg,png}" "build"

Solution is simple:
Update documentation that quote marks are required to surround the path.

Explanation:
Without quote marks all paths are expanded before the script is called.
The input to the script is all the individual files and not the pattern and globParent doesn't work as expected...