Fix compose file argument

fix #7
This commit is contained in:
2022-04-01 07:59:53 +02:00
parent 6a2417c361
commit 1dd8fef4b3
2 changed files with 8 additions and 3 deletions

View File

@@ -5,6 +5,7 @@ import (
"katenary/generator/writers"
"katenary/helm"
"katenary/update"
"log"
"strconv"
"github.com/spf13/cobra"
@@ -70,6 +71,7 @@ func main() {
if err != nil {
writers.IndentSize = indentation
}
log.Println("ComposeFile:", composeFile)
Convert(composeFile, appversion, appName, chartDir, force)
},
}

View File

@@ -93,9 +93,12 @@ func detectGitVersion() (string, error) {
}
func Convert(composeFile, appVersion, appName, chartDir string, force bool) {
composeFound := FindComposeFile()
if len(composeFile) == 0 {
fmt.Println("No compose file given")
return
}
_, err := os.Stat(ComposeFile)
if !composeFound && err != nil {
if err != nil {
fmt.Println("No compose file found")
os.Exit(1)
}
@@ -131,7 +134,7 @@ func Convert(composeFile, appVersion, appName, chartDir string, force bool) {
}
// Parse the compose file now
p := compose.NewParser(ComposeFile)
p := compose.NewParser(composeFile)
p.Parse(appName)
// start generator