File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import (
2222 "context"
2323 "errors"
2424 "fmt"
25+ "strings"
2526
2627 "github.com/onflow/flow-cli/internal/prompt"
2728
@@ -81,13 +82,20 @@ func deploy(
8182 if err != nil {
8283 var projectErr * flowkit.ProjectDeploymentError
8384 if errors .As (err , & projectErr ) {
85+ showUpdateHint := false
8486 for name , err := range projectErr .Contracts () {
8587 logger .Info (fmt .Sprintf (
8688 "%s Failed to deploy contract %s: %s" ,
8789 output .ErrorEmoji (),
8890 name ,
8991 err .Error (),
9092 ))
93+ if ! deployFlags .Update && (strings .Contains (err .Error (), "exists in account" ) || strings .Contains (err .Error (), "already exists" )) {
94+ showUpdateHint = true
95+ }
96+ }
97+ if showUpdateHint {
98+ logger .Info (fmt .Sprintf ("%s Contract already exists. To update it, run: flow project deploy --update" , output .TryEmoji ()))
9199 }
92100 return nil , fmt .Errorf ("failed deploying all contracts" )
93101 }
You can’t perform that action at this time.
0 commit comments