Skip to content

Commit bcbf5da

Browse files
committed
Remove obsolete try/catch since spawnSync is used
1 parent f4d6575 commit bcbf5da

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

tools/local-env/scripts/docker.js

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,17 @@ if ( process.argv.includes( '--coverage-html' ) ) {
1414
process.env.LOCAL_PHP_XDEBUG_MODE = 'coverage';
1515
}
1616

17-
// This try-catch prevents the superfluous Node.js debugging information from being shown if the command fails.
18-
try {
19-
// Execute any Docker compose command passed to this script.
20-
spawnSync(
21-
'docker',
22-
[
23-
'compose',
24-
...composeFiles
25-
.map( ( composeFile ) => [ '-f', composeFile ] )
26-
.flat(),
27-
...process.argv.slice( 2 ),
28-
],
29-
{ stdio: 'inherit' }
30-
);
31-
} catch ( error ) {
32-
process.exit( 1 );
33-
}
17+
// Execute any Docker compose command passed to this script.
18+
const returns = spawnSync(
19+
'docker',
20+
[
21+
'compose',
22+
...composeFiles
23+
.map( ( composeFile ) => [ '-f', composeFile ] )
24+
.flat(),
25+
...process.argv.slice( 2 ),
26+
],
27+
{ stdio: 'inherit' }
28+
);
29+
30+
process.exit( returns.status );

0 commit comments

Comments
 (0)