Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update step.go #29

Merged
merged 2 commits into from
Aug 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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