Fixup the command line argument to get multiple compose files

This commit is contained in:
2022-06-10 09:47:15 +02:00
parent e5d4ed1df5
commit 5a8a1b135e
2 changed files with 6 additions and 10 deletions

View File

@@ -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)
},
}

View File

@@ -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
}
}