简体   繁体   English

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

[英]selecting every file in every sub-folder

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. 在我的我的咕噜-的contrib手表任务的服务器部分,我要听在我的服务器文件夹中的所有文件中的所有文件改变所有子文件夹。 Does it have to be done like this, eg ** = subfolder, * is file? 是否必须这样做,例如** =子文件夹,*是文件?

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! 谢谢!

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']

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Google云端硬盘/电子表格 - 在子文件夹中修改文件时的电子邮件通知 - Google drive/spreadsheet - email notification when file is modified in sub-folder jQuery不会选择每个图像 - jQuery not selecting every image 编辑内置的Chrome书签管理器文件夹/子文件夹自动扩展? - Editing Built-in Chrome Bookmarks Manager Folder/Sub-Folder Auto-Expansion? 对文件夹中的每个文件重复一部分JS&JQuery代码 - Repeat a part of JS & JQuery code for every file in a folder 使子文件夹中的文件直接在npm import root下可用 - Making files in sub-folder available directly under npm import root 使用ENVDTE时的Java脚本-将新项目添加到现有解决方案中并将其放在特定的子文件夹中 - Java Script while using ENVDTE - Add new project to existing solution and locate it in a specific sub-folder 如何从子文件夹页面直接引导主页(索引)(图像输出) - How to direct main page (index) from sub-folder page (image out) 从子文件夹运行eslint时无法解析相对的模块路径 - Unable to resolve relative module paths when eslint run from sub-folder 为什么使用 app/ 上的 [locale] 子文件夹在 NextJS 13 上国际化不起作用 - Why internationalization is not working on NextJS 13 using a [locale] sub-folder on app/ 在每个div X中选择#2元素 - Selecting #2 element inside every div X
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM