From b9c11916c3f285332995ec1c0eb84ffd262b45fd Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Wed, 29 May 2019 08:36:51 -0400 Subject: [PATCH] Build: Assign non-zero exit code on build error Co-Authored-By: Daniel Richards --- bin/packages/build.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bin/packages/build.js b/bin/packages/build.js index 8413e6b708b7f..0f77d13ff06df 100755 --- a/bin/packages/build.js +++ b/bin/packages/build.js @@ -71,6 +71,15 @@ stream onFileComplete(); if ( error ) { + // If an error occurs, the process can't be ended immediately since + // other workers are likely pending. Optimally, it would end at the + // earliest opportunity (after the current round of workers has had + // the chance to complete), but this is not made directly possible + // through `worker-farm`. Instead, ensure at least that when the + // process does exit, it exits with a non-zero code to reflect the + // fact that an error had occurred. + process.exitCode = 1; + console.error( error ); }