问题描述
我有咕噜目标:
docs:{
files:{'<%= site.tmp%> /':['<%= site.pages%> / ** /*.html']}
},
如果没有匹配的内容,抱怨说:警告:找不到源文件,使用 - 强制继续。任务然后中止。我不介意警告,但我希望可以选择将任务配置为继续,而不必在命令行上使用--force。这可能吗?
ps。此任务现在失败的原因是我已将内容转换为降价。我试图建立一个脚手架,允许用户以任何组合使用markdown,hbs或html。
我有咕噜目标:
docs:{
files:{'<%= site.tmp%> /':['<%= site.pages%> / ** /*.html']}
},
如果没有匹配的内容,抱怨说:警告:找不到源文件,使用 - 强制继续。任务然后中止。我不介意警告,但我希望可以选择将任务配置为继续,而不必在命令行上使用--force。这可能吗?
ps。此任务现在失败的原因是我已将内容转换为降价。我试图建立一个脚手架,允许用户以任何组合使用markdown,hbs或html。
文档:{
files:{'<% = site.tmp%> /':['<%= site.pages%> / ** / *。{html,hbs,md}']}
},
该代码基本上查找以 .html
, .hbs
或 .md
。
由于这真的是Grunt错误,您只需编写文件
对象以允许更多的可能性。
例如,上述内容只适用于该位置实际上有文件的情况。如果Grunt在该位置查找并且没有看到任何可接受的文件,它将显示您现在正在获取的错误。
I have this assemble grunt target:
docs: {
files: {'<%= site.tmp %>/': ['<%= site.pages %>/**/*.html'] }
},
If there is no matching content, it complains, saying "Warning: Source files not found. Use --force to continue". The task then aborts. I don't mind the warning but I would like the option to configure the task to continue rather than having to use "--force" on the command line. Is this possible?
ps. The reason why this task is now failing is that I have converted the content to markdown. I am trying to build a scaffold that allows users to use markdown, hbs or html in any combination.
Based on what you are saying, you can use a little unix trick here.
docs: {
files: {'<%= site.tmp %>/': ['<%= site.pages %>/**/*.{html,hbs,md}'] }
},
That code basically looks for anything ending in .html
, .hbs
, or .md
.
Since this is really a Grunt error, you would need to simply write your file
object to allow for more possibilities.
For example, the above would only work if the location actually has files. If Grunt looks in that location and doesn't see any of the acceptable files, it will display the error you are getting now.
这篇关于如果没有匹配的文件,汇编目标可以被抑制吗? (不使用--force)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!