Allow several compose file in -c arg

This commit is contained in:
2022-06-03 16:17:53 +02:00
parent 1350a26162
commit 4cf470f222
2 changed files with 24 additions and 14 deletions

View File

@@ -98,14 +98,22 @@ func Convert(composeFile, appVersion, appName, chartDir, chartVersion string, fo
fmt.Println("No compose file given")
return
}
_, err := os.Stat(composeFile)
if err != nil {
fmt.Println("No compose file found")
os.Exit(1)
composeFiles := strings.Split(composeFile, ",")
for i, c := range composeFiles {
composeFiles[i] = strings.TrimSpace(c)
}
for _, composeFile := range composeFiles {
_, err := os.Stat(composeFile)
if err != nil {
fmt.Println("Error reading file:", composeFile)
os.Exit(1)
}
}
// Parse the compose file now
p := compose.NewParser(composeFile)
p := compose.NewParser(composeFiles)
p.Parse(appName)
dirname := filepath.Join(chartDir, appName)