diff options
author | Jacob Evans <jacob@dekz.net> | 2018-10-11 06:56:49 +0800 |
---|---|---|
committer | Jacob Evans <jacob@dekz.net> | 2018-10-11 06:56:49 +0800 |
commit | 01ccd8ff1a995f6b74f52533bc595cbc428b9eef (patch) | |
tree | 4b852959897f6765ccf387d979ca0bab5b0b967c | |
parent | afb34da72978b5272cfb5a235498e483c72556bc (diff) | |
download | dexon-sol-tools-01ccd8ff1a995f6b74f52533bc595cbc428b9eef.tar dexon-sol-tools-01ccd8ff1a995f6b74f52533bc595cbc428b9eef.tar.gz dexon-sol-tools-01ccd8ff1a995f6b74f52533bc595cbc428b9eef.tar.bz2 dexon-sol-tools-01ccd8ff1a995f6b74f52533bc595cbc428b9eef.tar.lz dexon-sol-tools-01ccd8ff1a995f6b74f52533bc595cbc428b9eef.tar.xz dexon-sol-tools-01ccd8ff1a995f6b74f52533bc595cbc428b9eef.tar.zst dexon-sol-tools-01ccd8ff1a995f6b74f52533bc595cbc428b9eef.zip |
[fix]: [testnet-faucet] Exit 1 on build fail
If we detect any compilation errors then exit with 1
-rw-r--r-- | packages/testnet-faucets/gulpfile.js | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/packages/testnet-faucets/gulpfile.js b/packages/testnet-faucets/gulpfile.js index 7c4e25e0f..839ef851b 100644 --- a/packages/testnet-faucets/gulpfile.js +++ b/packages/testnet-faucets/gulpfile.js @@ -14,10 +14,7 @@ const config = { }, devtool: 'source-map', resolve: { - modules: [ - path.join(__dirname, '/src/ts'), - 'node_modules', - ], + modules: [path.join(__dirname, '/src/ts'), 'node_modules'], extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'], alias: { ts: path.join(__dirname, '/src/ts'), @@ -44,10 +41,10 @@ const config = { }), ], externals: nodeExternals({ - modulesDir: path.join(__dirname, '../../node_modules') + modulesDir: path.join(__dirname, '../../node_modules'), }), watchOptions: { - ignored: /server|node_modules|transpiled/ + ignored: /server|node_modules|transpiled/, }, }; @@ -77,16 +74,18 @@ gulp.task('run', ['watch'], function() { }); function onBuild(done) { - return function(err, stats) { - if(err) { - console.log('Error', err); - } - else { - console.log(stats.toString()); - } - - if(done) { - done(); - } - } + return function(err, stats) { + if (err) { + console.log('Error', err); + process.exit(1); + } else { + console.log(stats.toString()); + } + if (done) { + if (stats.compilation.errors && stats.compilation.errors.length > 0) { + process.exit(1); + } + done(); + } + }; } |