From 0b248aad6b7de669e8dc6cb4283b2f5675d97795 Mon Sep 17 00:00:00 2001 From: Boming Zhang Date: Sat, 5 Oct 2024 03:13:24 -0400 Subject: [PATCH] feat: unique stages names --- cmd/joj3/main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/joj3/main.go b/cmd/joj3/main.go index 40bfd65..a211105 100644 --- a/cmd/joj3/main.go +++ b/cmd/joj3/main.go @@ -34,10 +34,16 @@ func getCommitMsg() (msg string, err error) { func generateStages(conf Conf, group string) ([]stage.Stage, error) { stages := []stage.Stage{} + existNames := map[string]bool{} for _, s := range conf.Stages { if s.Group != "" && group != s.Group { continue } + _, ok := existNames[s.Name] // check for existence + if ok { + continue + } + existNames[s.Name] = true var cmds []stage.Cmd defaultCmd := s.Executor.With.Default for _, optionalCmd := range s.Executor.With.Cases {