Skip to content

Commit d80d7a9

Browse files
committed
fix: remove duplicate config file paths
1 parent e8d050c commit d80d7a9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cmd/docker-gen/main.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"os"
88
"os/signal"
99
"path/filepath"
10+
"slices"
1011
"strings"
1112
"syscall"
1213

@@ -49,7 +50,6 @@ func (strings *stringslice) String() string {
4950
}
5051

5152
func (strings *stringslice) Set(value string) error {
52-
// TODO: Throw an error for duplicate `dest`
5353
*strings = append(*strings, value)
5454
return nil
5555
}
@@ -150,6 +150,9 @@ func main() {
150150
os.Exit(1)
151151
}
152152

153+
slices.Sort(configFiles)
154+
configFiles = slices.Compact(configFiles)
155+
153156
if len(configFiles) > 0 {
154157
for _, configFile := range configFiles {
155158
err := loadConfig(configFile)
@@ -187,7 +190,8 @@ func main() {
187190
cfg.NotifyContainersSignal = notifyContainerSignal
188191
}
189192
configs = config.ConfigFile{
190-
Config: []config.Config{cfg}}
193+
Config: []config.Config{cfg},
194+
}
191195
}
192196

193197
all := false

0 commit comments

Comments
 (0)