-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shouldn't an error be thrown if concat can't find an input file? #17
Comments
It should issue a warning: https://github.com/gruntjs/grunt-contrib-concat/blob/master/tasks/concat.js#L40 Does it not for you? |
I messed around with my paths so they're incorrect and I'm not seeing any "not found" warnings in the log after build... |
Can you post your gruntfile and output? |
gruntfile: https://gist.github.com/zakdances/af5b7feacfde32f5c063 output: http://pastebin.com/QKEAVDP4 gist when I tried to paste my output, so I used pastebin |
Hey sorry for the super late reply on this. I think you just need to set the |
I've had the same problem. This can cause problems in automated builds, because the build task doesn't fail and it deploys a broken application. Can I suggest the following:
|
See Issue #15 I have a fork that will abort on missing files. Haven't had the time to sort out tests for it so have not issued a pull request. |
FWIW, we get requests both ways on this. Some think tasks should display a warning, some think it should fail and some even think it should pass silently. See gruntjs/grunt-contrib-less#65 I think we need to draft a contrib task error handling guide, we all discuss it, merge it into the docs and normalize how things like this are handled across the contrib tasks. |
Sounds good. I can see use cases for silent, warning and fail depending on the task. Thanks. |
The problem I've had with automated builds (Teamcity in my case) is not so much that the grunt tasks continue, but that the build runner doesn't recognise grunt warnings as a sign that something has failed. Exiting with < 0 is a blunt way to communicate and as @shama points out users have different needs. I'm not sure this is a problem grunt should solve. I took another approach by hooking into grunt |
It should be "grunt.fail.warn" instead of "grunt.log.warn". A warning without failure is useless. You could silently fail by leaving the 'nonull' option off, or running grunt with the --force flag. |
I am working around this issue by running the following task before concat.
|
Ideally it should be configured by the end user. But rather then implementing yet another option™ I think we should do it right and have it configurable in the logging. prolog will be the library that will replace the grunt logging and will let us do that and more. |
👍 |
Currently it just silently fails.
The text was updated successfully, but these errors were encountered: