Skip to content

Commit

Permalink
Build: Assign non-zero exit code on build error
Browse files Browse the repository at this point in the history
Co-Authored-By: Daniel Richards <[email protected]>
  • Loading branch information
aduth and talldan committed May 29, 2019
1 parent d797c5b commit cb51568
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions bin/packages/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}

Expand Down

0 comments on commit cb51568

Please sign in to comment.