問(wèn)題描述
我在我的小項(xiàng)目中使用 Gulp 來(lái)運(yùn)行測(cè)試和 lint 我的代碼.當(dāng)這些任務(wù)中的任何一個(gè)失敗時(shí),Gulp 總是以返回代碼 0 退出.如果我手動(dòng)運(yùn)行 jshint,它應(yīng)該以非零代碼退出.
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.
這是我非常簡(jiǎn)單的 gulpfile.
我是否需要以某種方式明確告訴 Gulp 返回一個(gè)有意義的值?這是 Gulp 的錯(cuò),還是 gulp-jshint 和 gulp-jasmine 插件的錯(cuò)?
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!
這篇關(guān)于任務(wù)失敗時(shí) Gulp 返回 0的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!