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

rohit pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git


The following commit(s) were added to refs/heads/main by this push:
     new 5210bf9  fix: reuse cmk's CLI params to call piped cmd (#114)
5210bf9 is described below

commit 5210bf91a0bcbad8f4c0336a52b4fc64c0975fdd
Author: Claudio Netto <[email protected]>
AuthorDate: Tue Sep 20 03:27:56 2022 -0300

    fix: reuse cmk's CLI params to call piped cmd (#114)
---
 cli/exec.go | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cli/exec.go b/cli/exec.go
index 27ff811..bf3948b 100644
--- a/cli/exec.go
+++ b/cli/exec.go
@@ -40,7 +40,8 @@ func ExecLine(line string) error {
        if runtime.GOOS != "windows" {
                for _, arg := range args {
                        if arg == "|" {
-                               result, err := exec.Command("bash", "-c", 
fmt.Sprintf("%s %v", os.Args[0], line)).Output()
+                               fullCommand := fmt.Sprintf("%s %v", 
strings.Join(os.Args, " "), line)
+                               result, err := exec.Command("bash", "-c", 
fullCommand).Output()
                                fmt.Print(string(result))
                                return err
                        }

Reply via email to