Skip to content

Commit 5210bf9

Browse files
authored
fix: reuse cmk's CLI params to call piped cmd (#114)
1 parent 773fc17 commit 5210bf9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cli/exec.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ func ExecLine(line string) error {
4040
if runtime.GOOS != "windows" {
4141
for _, arg := range args {
4242
if arg == "|" {
43-
result, err := exec.Command("bash", "-c", fmt.Sprintf("%s %v", os.Args[0], line)).Output()
43+
fullCommand := fmt.Sprintf("%s %v", strings.Join(os.Args, " "), line)
44+
result, err := exec.Command("bash", "-c", fullCommand).Output()
4445
fmt.Print(string(result))
4546
return err
4647
}

0 commit comments

Comments
 (0)