Skip to content
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

Add failOnError option to play nice with watch #70

Closed
wants to merge 1 commit into from

Conversation

hurrymaplelad
Copy link
Contributor

Make development time less frustrating. I like to do a full build before I setup watchers in development.

Currently, If I have a stray syntax error in a stylus file when I fire up my development environment grunt dies on the full build before the watchers are setup. I go fix the error, then have to manually start the development task again.

With this change, grunt still logs the stylus syntax error to help me troubleshoot, but happily carries on to setup watchers and rebuild styles as soon as I fix the error.

Inspired by grunt-shell and others.

Fixes #51. Alternative to #52.

@sindresorhus
Copy link
Member

@hurrymaplelad
Copy link
Contributor Author

Watch's forever only kicks in after the watch has started. I've got Gruntfiles where I version image files, then build stylus files, then watch for changes in stylus sources. The first build can fail before watch clobbers fatal :(

@shama
Copy link
Member

shama commented Jan 2, 2014

Actually would you mind just updating this to grunt.log.warn instead? Currently some tasks abort and other don't. I spoke to @cowboy about it awhile back and he said just warn on errors. See: gruntjs/grunt-contrib-csslint#15 (comment)

@hurrymaplelad
Copy link
Contributor Author

@shama sounds good, I'll switch to warn.

@hurrymaplelad
Copy link
Contributor Author

@shama done, but after making the change I don't like it. I feel pretty strongly that errors in tasks should cause grunt to exit with an error code to play nice in build scripts.

@vladikoff
Copy link
Member

gruntjs/grunt#1163

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stylus errors shouldnt cause watch to die
4 participants