diff --git a/.changeset/smart-coats-sing.md b/.changeset/smart-coats-sing.md new file mode 100644 index 000000000..0803998ee --- /dev/null +++ b/.changeset/smart-coats-sing.md @@ -0,0 +1,6 @@ +--- +"@layerzerolabs/devtools-evm-hardhat": patch +"@layerzerolabs/toolbox-hardhat": patch +--- + +Exit with error code when simulation fails to start diff --git a/packages/devtools-evm-hardhat/src/tasks/simulation/start.ts b/packages/devtools-evm-hardhat/src/tasks/simulation/start.ts index 2a5e72eeb..0fe9a1fa4 100644 --- a/packages/devtools-evm-hardhat/src/tasks/simulation/start.ts +++ b/packages/devtools-evm-hardhat/src/tasks/simulation/start.ts @@ -119,9 +119,13 @@ const action: ActionType = async ( // This is a very quick and dirty way to pass an optional --wait argument to docker compose up const additionalUpArgs: string[] = daemon ? ['--wait'] : [] - spawnSync('docker', ['compose', '-f', dockerComposePath, 'up', ...additionalUpArgs], { + const result = spawnSync('docker', ['compose', '-f', dockerComposePath, 'up', ...additionalUpArgs], { stdio: 'inherit', }) + + if (result.status !== 0) { + throw new Error(`docker compose up command failed with exit code ${result.status}`) + } } catch (error) { logger.error(`Failed to spawn docker compose up command for ${dockerComposePath}: ${error}`)