本文介紹了任務失敗時 Gulp 返回 0的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
限時送ChatGPT賬號..
我在我的小項目中使用 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的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!