问题描述:

I have the following directories tree:

- client

- plugins

- plugin1

- plugin2

- plugin3

- widgets

- widget1

- widget2

- resources

- img

I need to copy all files from resources belonging to any particular plugin widget into one folder using grunt copy, so I'm using the following globbing pattern to find those files:

src: 'client/plugins/**/*/resources/img/*'

But it doesn't seem to be able to find them, so I guess the pattern is wrong. Where is my mistake?

网友答案:

I don't think you can use a specific directory after using the ** pattern because that already matches any subfolder. I think you'll need to be more specific:

src: 'client/plugins/*/widgets/*/resources/img/*'

If you can't use "widgets" exactly, then you'll need to find another alternative, maybe just using another /*/. You can find all of the globbing options in the node-glob Github repo README file. This includes things like anti-patterns if it comes to that.

相关阅读:
Top