Skip to content

Commit

Permalink
Update step.go (#29)
Browse files Browse the repository at this point in the history
* Update step.go

* Update step.go
  • Loading branch information
godrei committed Aug 28, 2023
1 parent 4444b09 commit a6b39a6
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions step.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,26 @@ func (g SchemeGenerator) Run(cfg Config) error {
log.Infof("Collecting existing Schemes...")
containerToSchemes, err := container.schemes()
if err != nil {
return fmt.Errorf("getting schemes failed: %w", err)
log.Warnf("Failed to list schemes: %s", err)
}

log.Printf("Schemes:")
printSchemes(true, containerToSchemes, cfg.ContainerPath)
preexistingSharedSchemes := numberOfSharedSchemes(containerToSchemes)
if preexistingSharedSchemes > 0 {
fmt.Println()
log.Donef("There are %d shared Scheme(s).", preexistingSharedSchemes)
return nil
if len(containerToSchemes) > 0 {
log.Printf("Schemes:")
printSchemes(true, containerToSchemes, cfg.ContainerPath)

preexistingSharedSchemes := numberOfSharedSchemes(containerToSchemes)
if preexistingSharedSchemes > 0 {
fmt.Println()
log.Donef("There are %d shared Scheme(s).", preexistingSharedSchemes)
return nil
}
}

// Generate schemes
fmt.Println()
log.Errorf("No shared Schemes found...")
log.Errorf("The newly generated Schemes may differ from the ones in your Project.")
log.Errorf("Make sure to share your Schemes, to prevent unexpected behaviour.")
log.Warnf("No shared Schemes found...")
log.Warnf("The newly generated Schemes may differ from the ones in your Project.")
log.Warnf("Make sure to share your Schemes, to prevent unexpected behaviour.")

fmt.Println()
log.Infof("Generating Schemes...")
Expand Down

0 comments on commit a6b39a6

Please sign in to comment.