From 5a8a1b135ed7249b6008977724cc1373bfffd215 Mon Sep 17 00:00:00 2001 From: Patrice Ferlet Date: Fri, 10 Jun 2022 09:47:15 +0200 Subject: [PATCH] Fixup the command line argument to get multiple compose files --- cmd/katenary/main.go | 2 -- cmd/katenary/utils.go | 14 ++++++-------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/cmd/katenary/main.go b/cmd/katenary/main.go index de1ff9b..ceaea8e 100644 --- a/cmd/katenary/main.go +++ b/cmd/katenary/main.go @@ -5,7 +5,6 @@ import ( "katenary/generator/writers" "katenary/helm" "katenary/update" - "log" "strconv" "github.com/spf13/cobra" @@ -71,7 +70,6 @@ func main() { if err != nil { writers.IndentSize = indentation } - log.Println(composeFiles) Convert(*composeFiles, appversion, appName, chartDir, chartVersion, force) }, } diff --git a/cmd/katenary/utils.go b/cmd/katenary/utils.go index 2f6d071..118932e 100644 --- a/cmd/katenary/utils.go +++ b/cmd/katenary/utils.go @@ -99,15 +99,13 @@ func Convert(composeFile []string, appVersion, appName, chartDir, chartVersion s return } - for i, c := range composeFile { - composeFile[i] = strings.TrimSpace(c) - } + composeFiles := composeFile + ComposeFile = composeFiles[0] - for _, composeFile := range composeFiles { - _, err := os.Stat(composeFile) - if err != nil { - fmt.Println("Error reading file:", composeFile) - os.Exit(1) + for _, cf := range composeFiles { + if _, err := os.Stat(cf); err != nil { + fmt.Printf("Compose file %s not found\n", cf) + return } }