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 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/scripts/scripts/build.js
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
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 );