Gulp returns 0 when tasks fail(任务失败时 Gulp 返回 0)
问题描述
我在我的小项目中使用 Gulp 来运行测试和 lint 我的代码.当这些任务中的任何一个失败时,Gulp 总是以返回代码 0 退出.如果我手动运行 jshint,它应该以非零代码退出.
I'm using Gulp in my small project in order to run tests and lint my code. When any of those tasks fail, Gulp always exits with return code 0. If I run jshint by hand, it exits with non-zero code as it should.
这是我非常简单的 gulpfile.
我是否需要以某种方式明确告诉 Gulp 返回一个有意义的值?这是 Gulp 的错,还是 gulp-jshint 和 gulp-jasmine 插件的错?
Do I need to somehow explicitly tell Gulp to return a meaningful value? Is this Gulp's fault, or maybe the gulp-jshint and gulp-jasmine plugins are to blame?
推荐答案
此提交.
它的工作原理是这样的:
It works something like this:
gulp.src("src/**/*.js")
.pipe(jshint())
.pipe(jshint.reporter("default"))
.pipe(jshint.reporter("fail"));
我一直在 circleci 上使用它,效果很好!
I have been using it on circleci and it works a treat!
这篇关于任务失败时 Gulp 返回 0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:任务失败时 Gulp 返回 0


- 如何调试 CSS/Javascript 悬停问题 2022-01-01
- 如何显示带有换行符的文本标签? 2022-01-01
- 是否可以将标志传递给 Gulp 以使其以不同的方式 2022-01-01
- 在不使用循环的情况下查找数字数组中的一项 2022-01-01
- 为什么我的页面无法在 Github 上加载? 2022-01-01
- 使用 iframe URL 的 jQuery UI 对话框 2022-01-01
- 我不能使用 json 使用 react 向我的 web api 发出 Post 请求 2022-01-01
- 为什么悬停在委托事件处理程序中不起作用? 2022-01-01
- 如何向 ipc 渲染器发送添加回调 2022-01-01
- 从原点悬停时触发 translateY() 2022-01-01