Skip to content
This repository has been archived by the owner on Nov 26, 2020. It is now read-only.

Commit

Permalink
bugfix: remove exec command from logs
Browse files Browse the repository at this point in the history
  • Loading branch information
farshidtz committed Feb 22, 2020
1 parent 5e4d591 commit 2eef720
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions agent/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ func (e *executor) execute(command string) (success bool) {
// Use exec to replace the shell process, rather than making a subprocess.
// This is necessary to propagate interrupt signal to certain programs.
if !strings.HasPrefix(strings.TrimSpace(command), "exec") {
command = "exec " + command
e.cmd = exec.Command("/bin/sh", "-c", "exec "+command)
} else {
e.cmd = exec.Command("/bin/sh", "-c", command)
}

bashCommand := []string{"/bin/sh", "-c", command}
e.cmd = exec.Command(bashCommand[0], bashCommand[1:]...)
defer func() { e.cmd = nil }()

e.cmd.Dir = e.workDir
Expand Down

0 comments on commit 2eef720

Please sign in to comment.