fix(err): When Katenary fails, help message was displayed

This is because Cobra thought the command was not correct.
This commit is contained in:
2025-09-23 12:28:58 +02:00
parent b8333eacf2
commit f0436ebce1

View File

@@ -146,11 +146,11 @@ func generateConvertCommand() *cobra.Command {
convertCmd := &cobra.Command{
Use: "convert",
Short: "Converts a docker-compose file to a Helm Chart",
RunE: func(cmd *cobra.Command, args []string) error {
Run: func(cmd *cobra.Command, args []string) {
if len(strings.TrimSpace(givenAppVersion)) > 0 {
appVersion = &givenAppVersion
}
return generator.Convert(generator.ConvertOptions{
if err := generator.Convert(generator.ConvertOptions{
Force: force,
OutputDir: outputDir,
Profiles: profiles,
@@ -159,7 +159,9 @@ func generateConvertCommand() *cobra.Command {
ChartVersion: chartVersion,
Icon: icon,
EnvFiles: envFiles,
}, dockerComposeFile...)
}, dockerComposeFile...); err != nil {
os.Exit(1)
}
},
}