wmedvede commented on code in PR #3028:
URL: 
https://github.com/apache/incubator-kie-tools/pull/3028#discussion_r2100721966


##########
packages/kn-plugin-workflow/pkg/command/quarkus/quarkus_project.go:
##########
@@ -205,12 +205,15 @@ func manipulatePomToKogito(filename string, cfg 
CreateQuarkusProjectConfig) erro
 }
 
 func manipulateDockerIgnore(filename string) error {
-       line := "\n!target/classes/workflow.sw.json"
+       pattern := "\n!target/classes/*.sw.%s"
+       extensions := []string{"json", "yaml", "yml"}
        f, err := os.OpenFile(filename, os.O_APPEND|os.O_WRONLY, 0644)
        defer f.Close()
 
-       if _, err := f.WriteString(line); err != nil {
-               return fmt.Errorf("error writing to %s: %w", filename, err)
+       for _, extension := range extensions {
+               if _, err := f.WriteString(fmt.Sprintf(pattern,extension)); err 
!= nil {
+                       return fmt.Errorf("error writing to %s: %w", filename, 
err)
+               }
        }
 
        if err != nil {

Review Comment:
   I think this condition and the subsequent error ""error opening" should go 
before doing the writing iteration.



-- 
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]

Reply via email to