diff --git a/pkg/commands/deploy_actions.go b/pkg/commands/deploy_actions.go index 680e794e..b22dea90 100644 --- a/pkg/commands/deploy_actions.go +++ b/pkg/commands/deploy_actions.go @@ -235,12 +235,6 @@ func DeployL1ContractsAction(cCtx *cli.Context) error { logger := common.LoggerFromContext(cCtx) caser := cases.Title(language.English) - // Check if docker is running, else try to start it - err := common.EnsureDockerIsRunning(cCtx) - if err != nil { - return cli.Exit(err.Error(), 1) - } - // Start timing execution runtime startTime := time.Now() @@ -261,6 +255,7 @@ func DeployL1ContractsAction(cCtx *cli.Context) error { contextName := cCtx.String("context") // Check for context + var err error var yamlPath string var rootNode, contextNode *yaml.Node if contextName == "" { diff --git a/pkg/commands/devnet_actions.go b/pkg/commands/devnet_actions.go index 7164cda4..9c8acb17 100644 --- a/pkg/commands/devnet_actions.go +++ b/pkg/commands/devnet_actions.go @@ -330,6 +330,13 @@ func StartDevnetAction(cCtx *cli.Context) error { // Deploy the contracts after starting devnet unless skipped if !skipDeployContracts { + // Check if docker is running, else try to start it + err := common.EnsureDockerIsRunning(cCtx) + if err != nil { + return cli.Exit(err.Error(), 1) + } + + // Call deploy L1 action within devnet context if err := DeployL1ContractsAction(cCtx); err != nil { return fmt.Errorf("deploy-contracts failed - please restart devnet and try again: %w", err) }