3

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.

jonschlinkert
  • 10,872
  • 4
  • 43
  • 50
Philip Daniels
  • 994
  • 1
  • 7
  • 25
  • create an issue on github. sounds like a good feature request. – jonschlinkert Mar 27 '14 at 17:49
  • 1
    actually is this an assemble error or a grunt error? this problem can easily be solved with other assemble solutions, but the question is about error messages. if you want other ideas perhaps you should create a new question about what you're trying to achieve. – jonschlinkert Apr 28 '14 at 00:17

1 Answers1

1

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.

Kelly J Andrews
  • 5,083
  • 1
  • 19
  • 32