tomasdavidorg commented on code in PR #2092:
URL:
https://github.com/apache/incubator-kie-tools/pull/2092#discussion_r1425253668
##########
packages/kn-plugin-workflow/pkg/command/deploy_undeploy_common.go:
##########
@@ -75,42 +80,71 @@ func checkEnvironment(cfg *DeployUndeployCmdConfig) error {
}
func generateManifests(cfg *DeployUndeployCmdConfig) error {
+
+ workflowExtensionsType := []string{metadata.YAMLSWExtension,
metadata.YMLSWExtension, metadata.JSONSWExtension}
+
fmt.Println("\nš ļø Generating your manifests...")
+
fmt.Println("š Looking for your SonataFlow files...")
- if file, err := findSonataFlowFile(); err != nil {
+ if file, err := findSonataFlowFile(workflowExtensionsType); err != nil {
return err
} else {
cfg.SonataFlowFile = file
}
fmt.Printf(" - ā
SonataFlow file found: %s\n", cfg.SonataFlowFile)
- fmt.Println("š Looking for your configuration support files...")
+ fmt.Println("š Looking for your SonataFlow sub flows...")
+ files, err := common.FindFilesWithExtensions(cfg.SubflowsDir,
workflowExtensionsType)
+ if err != nil {
+ return fmt.Errorf("ā ERROR: failed to get subflows directory:
%w", err)
+ }
+ cfg.SubFlowsFilesPath = files
+ for _, file := range cfg.SubFlowsFilesPath {
+ fmt.Printf(" - ā
SonataFlow subflows found: %s\n", file)
+ }
+
+ fmt.Println("š Looking for your workflow support files...")
dir, err := os.Getwd()
if err != nil {
return fmt.Errorf("ā ERROR: failed to get current directory:
%w", err)
}
+ fmt.Println("š Looking for properties files...")
+
applicationPropertiesPath := findApplicationPropertiesPath(dir)
if applicationPropertiesPath != "" {
cfg.ApplicationPropertiesPath = applicationPropertiesPath
fmt.Printf(" - ā
Properties file found: %s\n",
cfg.ApplicationPropertiesPath)
}
- supportFileExtensions := []string{".json", ".yaml", ".yml"}
+ supportFileExtensions := []string{metadata.JSONExtension,
metadata.YAMLSWExtension, metadata.YMLExtension}
Review Comment:
I think this should be:
```suggestion
supportFileExtensions := []string{metadata.JSONExtension,
metadata.YAMLExtension, metadata.YMLExtension}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]