选择每个子文件夹中的每个文件

时间:2022-02-22 00:30:03

This is hard to google cause I don't know how these expressions are called. In my the server part of my grunt-contrib-watch task I want to listen for all file changes in all files in all subfolders in my server folder. Does it have to be done like this, e.g. ** = subfolder, * is file?

这很难谷歌因为我不知道如何调用这些表达式。在我的grunt-contrib-watch任务的服务器部分中,我想监听服务器文件夹中所有子文件夹中所有文件的所有文件更改。是否必须这样做,例如** =子文件夹,*是文件?

files : [ 'server/**/**/*.*','server/**/*.*','server/*.*']

I've also seen something like:

我也见过这样的话:

files : [ 'server/{,*/}*.*' ]

but what are the curly braces doing there? In my conquest to pretty syntax, any help is greatly appreciated. Thanks!

但那里的花括号是什么?在我征服漂亮的语法时,非常感谢任何帮助。谢谢!

1 个解决方案

#1


0  

You can find the answer here: How grunt watch files in sub folders?, he gave the link to the document too. (So you can go vote up for his answer ^^)

你可以在这里找到答案:如何在子文件夹中查看文件?,他也提供了文档的链接。 (所以你可以投票支持他的答案^^)

In your case it should be:['server/**/*.*'] if you want every file, otherwise you can change the last * as js like this : ['server/**/*.js']

在你的情况下它应该是:['server /**/*.*']如果你想要每个文件,否则你可以改变最后的*为像这样的js:['server / ** / * .js']

#1


0  

You can find the answer here: How grunt watch files in sub folders?, he gave the link to the document too. (So you can go vote up for his answer ^^)

你可以在这里找到答案:如何在子文件夹中查看文件?,他也提供了文档的链接。 (所以你可以投票支持他的答案^^)

In your case it should be:['server/**/*.*'] if you want every file, otherwise you can change the last * as js like this : ['server/**/*.js']

在你的情况下它应该是:['server /**/*.*']如果你想要每个文件,否则你可以改变最后的*为像这样的js:['server / ** / * .js']