From a4047f450e6d8e1202035e1fda198cbdcef2369f Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sun, 21 Sep 2014 20:53:59 +0800 Subject: [PATCH] Release pipe commands --- shell/shells.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shell/shells.go b/shell/shells.go index 70d61d0..1a0d33a 100644 --- a/shell/shells.go +++ b/shell/shells.go @@ -145,6 +145,10 @@ func pipeCommands(username string, commands ...*exec.Cmd) string { out, err := last.CombinedOutput() + for _, command := range commands[:len(commands)-1] { + command.Wait() + } + if err != nil { return err.Error() }