You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ro...@apache.org on 2022/09/20 06:28:01 UTC

[cloudstack-cloudmonkey] branch main updated: fix: reuse cmk's CLI params to call piped cmd (#114)

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 <ne...@ufrj.br>
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
 			}