Skip to content

Commit

Permalink
🪲 Exit with error code when simulation fails to start (#607)
Browse files Browse the repository at this point in the history
  • Loading branch information
janjakubnanista authored May 9, 2024
1 parent 1a17245 commit 1e9b652
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/smart-coats-sing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@layerzerolabs/devtools-evm-hardhat": patch
"@layerzerolabs/toolbox-hardhat": patch
---

Exit with error code when simulation fails to start
6 changes: 5 additions & 1 deletion packages/devtools-evm-hardhat/src/tasks/simulation/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,13 @@ const action: ActionType<SimulationStartTaskArgs> = 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}`)

Expand Down

0 comments on commit 1e9b652

Please sign in to comment.