You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2020/09/03 12:30:59 UTC

[camel-k] 03/03: Fix #1668: fix out and err channels in command

This is an automated email from the ASF dual-hosted git repository.

nferraro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 1fc62eb0cd53d61b922d0fa2305d79788f399c40
Author: nicolaferraro <ni...@gmail.com>
AuthorDate: Wed Sep 2 17:30:20 2020 +0200

    Fix #1668: fix out and err channels in command
---
 pkg/cmd/run.go | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/pkg/cmd/run.go b/pkg/cmd/run.go
index f86545c..5c7e4c3 100644
--- a/pkg/cmd/run.go
+++ b/pkg/cmd/run.go
@@ -295,7 +295,7 @@ func (o *runCmdOptions) run(cmd *cobra.Command, args []string) error {
 	}
 
 	if o.Sync || o.Dev {
-		err = o.syncIntegration(c, args, catalog)
+		err = o.syncIntegration(cmd, c, args, catalog)
 		if err != nil {
 			return err
 		}
@@ -391,7 +391,7 @@ func (o *runCmdOptions) waitForIntegrationReady(cmd *cobra.Command, integration
 	return watch.HandleIntegrationStateChanges(o.Context, integration, handler)
 }
 
-func (o *runCmdOptions) syncIntegration(c client.Client, sources []string, catalog *trait.Catalog) error {
+func (o *runCmdOptions) syncIntegration(cmd *cobra.Command, c client.Client, sources []string, catalog *trait.Catalog) error {
 	// Let's watch all relevant files when in dev mode
 	var files []string
 	files = append(files, sources...)
@@ -413,6 +413,8 @@ func (o *runCmdOptions) syncIntegration(c client.Client, sources []string, catal
 					case <-changes:
 						// let's create a new command to parse modeline changes and update our integration
 						newCmd, _, err := createKamelWithModelineCommand(o.RootContext, os.Args[1:], make(map[string]bool))
+						newCmd.SetOut(cmd.OutOrStdout())
+						newCmd.SetErr(cmd.ErrOrStderr())
 						if err != nil {
 							fmt.Println("Unable to sync integration: ", err.Error())
 							continue