Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scripts: exit error code 1 when status value is null #42396

Merged
merged 4 commits into from
Jul 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/scripts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Bug Fix

- Fix the incorrect exit error code when status missing in `webpack` call for `build` and `start` commands ([#42396](https://github.com/WordPress/gutenberg/pull/42396)).

## 23.3.0 (2022-06-15)

### Enhancements
Expand Down
3 changes: 2 additions & 1 deletion packages/scripts/scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const { sync: resolveBin } = require( 'resolve-bin' );
* Internal dependencies
*/
const { getWebpackArgs, hasArgInCLI, getArgFromCLI } = require( '../utils' );
const EXIT_ERROR_CODE = 1;

process.env.NODE_ENV = process.env.NODE_ENV || 'production';

Expand All @@ -30,4 +31,4 @@ process.env.WP_SRC_DIRECTORY = hasArgInCLI( '--webpack-src-dir' )
const { status } = spawn( resolveBin( 'webpack' ), getWebpackArgs(), {
stdio: 'inherit',
} );
process.exit( status );
process.exit( status === null ? EXIT_ERROR_CODE : status );
3 changes: 2 additions & 1 deletion packages/scripts/scripts/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const { sync: resolveBin } = require( 'resolve-bin' );
* Internal dependencies
*/
const { getArgFromCLI, getWebpackArgs, hasArgInCLI } = require( '../utils' );
const EXIT_ERROR_CODE = 1;

if ( hasArgInCLI( '--webpack-no-externals' ) ) {
process.env.WP_NO_EXTERNALS = true;
Expand Down Expand Up @@ -36,4 +37,4 @@ const { status } = spawn(
stdio: 'inherit',
}
);
process.exit( status );
process.exit( status === null ? EXIT_ERROR_CODE : status );