gpt4 book ai didi

error-handling - gulp-tasks加载的任务失败后,错误退出

转载 作者:行者123 更新时间:2023-12-03 08:24:43 24 4
gpt4 key购买 nike

我正在与magento2-frontools合作,并尝试解决此问题:

https://github.com/SnowdogApps/magento2-frontools/issues/231

问题是,如果出现错误,gulp styles应该具有非零的退出代码,但是它会以0退出。

gulp文件如下所示:

// Tasks loading
require('gulp-task-loader')({
dir : 'task',
plugins: plugins,
configs: config
});

而styles.js任务是这样的:
  'use strict';
module.exports = function() { // eslint-disable-line func-names
// Global variables
const gulp = this.gulp,
plugins = this.opts.plugins,
config = this.opts.configs,
themes = plugins.getThemes(),
streams = plugins.mergeStream();

// Generate all necessary symlinks before styles compilation, but ony if not a part of tasks pipeline
if (!plugins.util.env.pipeline) {
plugins.runSequence('inheritance');
}

// Loop through themes to compile scss or less depending on your config.json
themes.forEach(name => {
streams.add(require('../helper/scss')(gulp, plugins, config, name));
});

return streams;
};

(都可以是 found on GitHub)

如果看过 this approach来解决问题:
.once("error", function () {
this.once("finish", () => process.exit(1));
})

但是我可以在哪里添加该代码?

最佳答案

仅需使用--ci标志。

关于error-handling - gulp-tasks加载的任务失败后,错误退出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45006766/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com